diff --git a/.github/workflows/gradle-plugin-tests.yaml b/.github/workflows/gradle-plugin-tests.yaml new file mode 100644 index 00000000000..a162019bf90 --- /dev/null +++ b/.github/workflows/gradle-plugin-tests.yaml @@ -0,0 +1,43 @@ +name: Gradle plugin tests + +on: + push: + paths: + - modules/openapi-generator-gradle-plugin/** + pull_request: + paths: + - modules/openapi-generator-gradle-plugin/** + +jobs: + test: + name: Gradle plugin tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: 'temurin' + - name: Cache maven dependencies + uses: actions/cache@v3 + env: + cache-name: cache-maven-repository + with: + path: | + ~/.m2/repository + ~/.gradle + !~/.gradle/caches/modules-2/modules-2.lock + !~/.gradle/caches/*/plugin-resolution/ + !~/.m2/repository/org/openapitools/ + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-test-gradle-plugin-${{ env.cache-name }}- + ${{ runner.os }}-test-gradle-plugin- + - name: Run tests + run: | + mvn --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error + (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk) # using gradle-6.8.3 via wrapper + (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate) + (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildDotnetSdk) + (cd modules/openapi-generator-gradle-plugin/samples/local-spec && gradle buildJavaResttemplateSdk) # not using gradle wrapper diff --git a/.github/workflows/gradle-test.yaml b/.github/workflows/gradle-test.yaml index 067377c11f1..e9b9dcf9c14 100644 --- a/.github/workflows/gradle-test.yaml +++ b/.github/workflows/gradle-test.yaml @@ -2,17 +2,12 @@ name: Gradle tests (Java samples) on: push: - branches: - - master - - '[5-9]+.[0-9]+.x' - - "java*" paths: - 'samples/client/petstore/java/**' + - 'samples/openapi3/client/petstore/java/**' pull_request: - branches: - - master - - '[5-9]+.[0-9]+.x' paths: + - 'samples/client/petstore/java/**' - 'samples/openapi3/client/petstore/java/**' env: GRADLE_VERSION: 7.2 @@ -26,11 +21,11 @@ jobs: fail-fast: true matrix: sample: - - samples/client/petstore/java/jersey2-java8-localdatetime - - samples/client/petstore/java/jersey2-java8 - samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8 - samples/openapi3/client/petstore/java/jersey2-java8-special-characters - samples/openapi3/client/petstore/java/jersey2-java8 + - samples/client/petstore/java/jersey2-java8-localdatetime + - samples/client/petstore/java/jersey2-java8 - samples/client/petstore/java/okhttp-gson - samples/client/petstore/java/okhttp-gson-group-parameter steps: diff --git a/.github/workflows/java-helidon-functional-tests.yaml b/.github/workflows/java-helidon-functional-tests.yaml new file mode 100644 index 00000000000..b2404063d8f --- /dev/null +++ b/.github/workflows/java-helidon-functional-tests.yaml @@ -0,0 +1,46 @@ +name: Java Helidon Functional tests + +on: + push: + paths: + - modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/** + pull_request: + paths: + - modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/** + +jobs: + build: + name: Java Helidon Functional tests + runs-on: ubuntu-latest + strategy: + matrix: + java-version: [11, 17] + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java-version }} + distribution: 'temurin' + - name: Cache maven dependencies + uses: actions/cache@v3 + env: + cache-name: cache-maven-repository + with: + path: | + ~/.m2/repository + ~/.gradle + !~/.gradle/caches/*/plugin-resolution/ + !~/.m2/repository/org/openapitools/ + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + - name: Run unit tests + run: cd modules/openapi-generator && mvn --no-snapshot-updates --batch-mode -Dtest="**/functional/*Test" test -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - name: Publish unit test reports + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: surefire-test-results + path: '**/surefire-reports/TEST-*.xml' diff --git a/.github/workflows/maven-plugin-tests.yaml b/.github/workflows/maven-plugin-tests.yaml new file mode 100644 index 00000000000..4f3fe58a2f1 --- /dev/null +++ b/.github/workflows/maven-plugin-tests.yaml @@ -0,0 +1,42 @@ +name: Maven plugin tests + +on: + push: + paths: + - modules/openapi-generator-maven-plugin/** + pull_request: + paths: + - modules/openapi-generator-maven-plugin/** + +jobs: + test: + name: Maven plugin tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: 'temurin' + - name: Cache maven dependencies + uses: actions/cache@v3 + env: + cache-name: cache-maven-repository + with: + path: | + ~/.m2/repository + ~/.gradle + !~/.gradle/caches/*/plugin-resolution/ + !~/.m2/repository/org/openapitools/ + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-test-maven-plugin-${{ env.cache-name }}- + ${{ runner.os }}-test-maven-plugin- + - name: Run tests + run: | + mvn clean install -DskipTests -Dmaven.javadoc.skip=true + mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index 423cec99062..fcbf678e89c 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -80,44 +80,6 @@ jobs: name: surefire-test-results path: '**/surefire-reports/TEST-*.xml' - functional-test: - name: Functional tests - runs-on: ubuntu-latest - needs: - - build - strategy: - matrix: - java-version: [11, 17] - steps: - - uses: actions/checkout@v3 - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java-version }} - distribution: 'temurin' - - name: Cache maven dependencies - uses: actions/cache@v3 - env: - cache-name: cache-maven-repository - with: - path: | - ~/.m2/repository - ~/.gradle - !~/.gradle/caches/*/plugin-resolution/ - !~/.m2/repository/org/openapitools/ - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - - name: Run unit tests - run: cd modules/openapi-generator && mvn --no-snapshot-updates --batch-mode -Dtest="**/functional/*Test" test -Dorg.slf4j.simpleLogger.defaultLogLevel=error - - name: Publish unit test reports - if: ${{ always() }} - uses: actions/upload-artifact@v3 - with: - name: surefire-test-results - path: '**/surefire-reports/TEST-*.xml' - documentation: name: Docs up-to-date runs-on: ubuntu-latest @@ -191,71 +153,3 @@ jobs: echo "Please run 'bin/generate-samples.sh' locally and commit changes (UNCOMMITTED CHANGES ERROR)" exit 1 fi - - test-maven-plugin: - name: Maven plugin tests - runs-on: ubuntu-latest - needs: - - build - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: 'temurin' - - name: Cache maven dependencies - uses: actions/cache@v3 - env: - cache-name: cache-maven-repository - with: - path: | - ~/.m2/repository - ~/.gradle - !~/.gradle/caches/*/plugin-resolution/ - !~/.m2/repository/org/openapitools/ - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-test-maven-plugin-${{ env.cache-name }}- - ${{ runner.os }}-test-maven-plugin- - - name: Run tests - run: | - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - - test-gradle-plugin: - name: Gradle plugin tests - runs-on: ubuntu-latest - needs: - - build - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: 'temurin' - - name: Cache maven dependencies - uses: actions/cache@v3 - env: - cache-name: cache-maven-repository - with: - path: | - ~/.m2/repository - ~/.gradle - !~/.gradle/caches/modules-2/modules-2.lock - !~/.gradle/caches/*/plugin-resolution/ - !~/.m2/repository/org/openapitools/ - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-test-gradle-plugin-${{ env.cache-name }}- - ${{ runner.os }}-test-gradle-plugin- - - name: Run tests - run: | - mvn --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error - (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk) # using gradle-6.8.3 via wrapper - (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate) - (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildDotnetSdk) - (cd modules/openapi-generator-gradle-plugin/samples/local-spec && gradle buildJavaResttemplateSdk) # not using gradle wrapper diff --git a/.github/workflows/samples-dotnet.yaml b/.github/workflows/samples-dotnet.yaml index b89b473d473..56a8ec2d4dd 100644 --- a/.github/workflows/samples-dotnet.yaml +++ b/.github/workflows/samples-dotnet.yaml @@ -27,7 +27,7 @@ jobs: - samples/server/petstore/aspnetcore-6.0-project4Models steps: - uses: actions/checkout@v3 - - uses: actions/setup-dotnet@v3.0.2 + - uses: actions/setup-dotnet@v3.0.3 with: dotnet-version: '6.0.x' - name: Build diff --git a/.github/workflows/samples-go.yaml b/.github/workflows/samples-go.yaml new file mode 100644 index 00000000000..a46a7ea9c22 --- /dev/null +++ b/.github/workflows/samples-go.yaml @@ -0,0 +1,36 @@ +name: Samples Go + +on: + push: + paths: + - 'samples/server/petstore/go-echo-server/**' + - 'samples/server/petstore/go-api-server/**' + pull_request: + paths: + - 'samples/server/petstore/go-echo-server/**' + - 'samples/server/petstore/go-api-server/**' + +jobs: + build: + name: Build Go + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + - samples/server/petstore/go-echo-server/ + - samples/server/petstore/go-api-server/ + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: '>=1.17.0' + - run: go version + - name: Install + working-directory: ${{ matrix.sample }} + run: | + go get github.com/labstack/echo/v4/middleware@v4.9.0 + go get github.com/labstack/echo/v4@v4.9.0 + - name: Build + working-directory: ${{ matrix.sample }} + run: go test -v diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml index c1f1bfa441f..9eaecf529b9 100644 --- a/.github/workflows/samples-kotlin-client.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -51,6 +51,11 @@ jobs: - samples/client/petstore/kotlin-bigdecimal-default-okhttp4 - samples/client/petstore/kotlin-jvm-ktor-jackson - samples/client/petstore/kotlin-jvm-ktor-gson + - samples/client/petstore/kotlin-jvm-ktor-gson + - samples/client/petstore/kotlin-jvm-vertx-gson + - samples/client/petstore/kotlin-jvm-vertx-jackson + - samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines + - samples/client/petstore/kotlin-jvm-vertx-moshi steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 diff --git a/.github/workflows/samples-scala.yaml b/.github/workflows/samples-scala.yaml index 81372fccdcb..0d71f743d67 100644 --- a/.github/workflows/samples-scala.yaml +++ b/.github/workflows/samples-scala.yaml @@ -1,23 +1,26 @@ -name: Samples Scala +name: Samples Scala/sbt on: push: paths: - 'samples/client/petstore/scala**' - 'samples/server/petstore/scala**' + - 'samples/client/petstore/java/okhttp-gson/**' pull_request: paths: - 'samples/client/petstore/scala**' - 'samples/server/petstore/scala**' + - 'samples/client/petstore/java/okhttp-gson/**' jobs: build: - name: Build Scala client, servers + name: Build sbt/Scala client, servers runs-on: ubuntu-latest strategy: fail-fast: false matrix: sample: # clients + - 'samples/client/petstore/java/okhttp-gson' - samples/client/petstore/scalaz #- samples/client/petstore/scala-sttp # won't pass while the same tests in circleci pass # servers diff --git a/.gitignore b/.gitignore index 850adb6fac6..c2192dfc5e2 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,9 @@ packages/ **/.vs .factorypath .metals/* +nbproject/ +nbactions.xml +nb-configuration.xml .settings diff --git a/README.md b/README.md index ba0dc63d569..d8413571da4 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ If you find OpenAPI Generator useful for work, please consider asking your compa [](https://www.onesignal.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) [](https://www.virtualansoftware.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) [](https://www.merge.dev/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) +[](https://www.burkert.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) +[](https://www.finbourne.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) #### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS and Checkly for sponsoring the API monitoring @@ -70,8 +72,8 @@ 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, 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), **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) | -| **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/)), **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 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, 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), **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) | +| **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/)), **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/) | | **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer**, **WSDL** | @@ -682,6 +684,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [TribalScale](https://www.tribalscale.com) - [Trifork](https://trifork.com) - [TUI InfoTec GmbH](http://www.tui-infotec.com/) +- [Twilio](https://www.twilio.com/) - [Twitter](https://twitter.com) - [unblu inc.](https://www.unblu.com/) - [Veamly](https://www.veamly.com/) @@ -872,6 +875,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2022-08-01 - [Tutorial: Etsy Open API v3 (ruby)](https://blog.tjoyal.dev/etsy-open-api-v3/) by [Thierry Joyal](https://github.com/tjoyal) - 2022-09-03 - [OpenAPI Generator For Go Web Development](https://blog.kevinhu.me/2022/09/03/03-openapi-generator/) by [Kevin Hu](https://twitter.com/Oldgunix) - 2022-10-01 - [OpenAPI Generatorをカスタマイズしたコードを生成する(Swagger Codegenとほぼ同じ)](https://nainaistar.hatenablog.com/entry/2022/10/03/120000) by [きり丸](https://twitter.com/nainaistar) +- 2022-10-21 - [Kotlin(Spring Boot)の API を OpenAPI Generator で自動生成](https://zenn.dev/msksgm/articles/20221021-kotlin-spring-openapi-generator) by [msksgm](https://zenn.dev/msksgm) +- 2022-10-26 - [Quarkus Insights #106: Quarkiverse Extension Spotlight: OpenApi Generator](https://www.youtube.com/watch?v=_s_if69t2iQ) by [Quarkusio](https://www.youtube.com/c/Quarkusio) ## [6 - About Us](#table-of-contents) @@ -942,6 +947,7 @@ Here is a list of template creators: * Java (Rest-assured): @viclovsky * Java (Java 11 Native HTTP client): @bbdouglas * Java (Apache HttpClient): @harrywhite4 + * Java (Helidon): @spericas @tjquinno @tvallin * Javascript/NodeJS: @jfiala * JavaScript (Apollo DataSource): @erithmetic * JavaScript (Closure-annotated Angular) @achew22 @@ -1009,6 +1015,7 @@ Here is a list of template creators: * Java PKMST: @anshu2185 @sanshuman @rkumar-pk @ninodpillai * Java Vert.x: @lwlee2608 * Java Micronaut: @andriy-dmytruk + * Java Helidon: @spericas @tjquinno @tvallin * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard diff --git a/bin/configs/kotlin-jvm-vertx-gson.yaml b/bin/configs/kotlin-jvm-vertx-gson.yaml new file mode 100644 index 00000000000..50bfafb94dc --- /dev/null +++ b/bin/configs/kotlin-jvm-vertx-gson.yaml @@ -0,0 +1,8 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-jvm-vertx-gson +library: jvm-vertx +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-jvm-vertx + serializationLibrary: "gson" \ No newline at end of file diff --git a/bin/configs/kotlin-jvm-vertx-jackson-coroutines.yaml b/bin/configs/kotlin-jvm-vertx-jackson-coroutines.yaml new file mode 100644 index 00000000000..64693cba0e7 --- /dev/null +++ b/bin/configs/kotlin-jvm-vertx-jackson-coroutines.yaml @@ -0,0 +1,9 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines +library: jvm-vertx +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-jvm-vertx + serializationLibrary: "jackson" + useCoroutines: "true" diff --git a/bin/configs/kotlin-jvm-vertx-jackson.yaml b/bin/configs/kotlin-jvm-vertx-jackson.yaml new file mode 100644 index 00000000000..f23e8f4237c --- /dev/null +++ b/bin/configs/kotlin-jvm-vertx-jackson.yaml @@ -0,0 +1,8 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-jvm-vertx-jackson +library: jvm-vertx +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-jvm-vertx + serializationLibrary: "jackson" \ No newline at end of file diff --git a/bin/configs/kotlin-jvm-vertx-moshi.yaml b/bin/configs/kotlin-jvm-vertx-moshi.yaml new file mode 100644 index 00000000000..e3d658c39f3 --- /dev/null +++ b/bin/configs/kotlin-jvm-vertx-moshi.yaml @@ -0,0 +1,8 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-jvm-vertx-moshi +library: jvm-vertx +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-jvm-vertx + serializationLibrary: "moshi" \ No newline at end of file diff --git a/bin/configs/spring-boot-oas3.yaml b/bin/configs/spring-boot-oas3.yaml index 21994a14ad4..1c4c87f1940 100644 --- a/bin/configs/spring-boot-oas3.yaml +++ b/bin/configs/spring-boot-oas3.yaml @@ -8,3 +8,4 @@ additionalProperties: artifactId: springboot snapshotVersion: "true" hideGenerationTimestamp: "true" + requestMappingMode: api_interface diff --git a/bin/configs/spring-boot.yaml b/bin/configs/spring-boot.yaml index fe2345e7126..c0d8268ae70 100644 --- a/bin/configs/spring-boot.yaml +++ b/bin/configs/spring-boot.yaml @@ -7,3 +7,4 @@ additionalProperties: artifactId: springboot snapshotVersion: "true" hideGenerationTimestamp: "true" + camelCaseDollarSign: "true" diff --git a/bin/configs/typescript-rxjs-allOf-composition.yaml b/bin/configs/typescript-rxjs-allOf-composition.yaml new file mode 100644 index 00000000000..e9bca87aa19 --- /dev/null +++ b/bin/configs/typescript-rxjs-allOf-composition.yaml @@ -0,0 +1,4 @@ +generatorName: typescript-rxjs +outputDir: samples/client/others/typescript-rxjs/allOf-composition +inputSpec: modules/openapi-generator/src/test/resources/3_0/allOf_composition.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-rxjs diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 76ec86abae0..e60f802f17b 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index e8f88e8269e..348f689876b 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |basePackage|base package (invokerPackage) for generated code| |org.openapitools| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |camelDataformatProperties|list of dataformat properties separated by comma (propertyName1=propertyValue2,...| || |camelRestBindingMode|binding mode to be used by the REST consumer| |auto| |camelRestClientRequestValidation|enable validation of the client request to check whether the Content-Type and Accept headers from the client is supported by the Rest-DSL configuration| |false| @@ -73,6 +74,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |performBeanValidation|Use Bean Validation Impl. to perform BeanValidation| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reactive|wrap responses in Mono/Flux Reactor types (spring-boot only)| |false| +|requestMappingMode|Where to generate the class level @RequestMapping annotation.|
**api_interface**
Generate the @RequestMapping annotation on the generated Api Interface.
**controller**
Generate the @RequestMapping annotation on the generated Api Controller Implementation.
**none**
Do not add a class level @RequestMapping annotation.
|controller| |responseWrapper|wrap the responses in given type (Future, Callable, CompletableFuture,ListenableFuture, DeferredResult, RxObservable, RxSingle or fully qualified type)| |null| |returnSuccessCode|Generated server returns 2xx code| |false| |scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md index 13b1af6a314..a2c57ac695e 100644 --- a/docs/generators/java-helidon-client.md +++ b/docs/generators/java-helidon-client.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |configKey|Config key in @RegisterRestClient. Default to none.| |null| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| |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| diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md index a33de1eb380..b96f1730758 100644 --- a/docs/generators/java-helidon-server.md +++ b/docs/generators/java-helidon-server.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| |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| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 52008c192a2..8dfd8797cd7 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 1adf78b70f9..b0368d3ef59 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -30,6 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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| |configureAuth|Configure all the authorization methods as specified in the file| |false| |dateFormat|Specify the format pattern of date as a string| |null| |dateLibrary|Option. Date library to use|
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index 715d9022d92..85422ca8bbc 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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| |controllerPackage|The package in which controllers will be generated| |org.openapitools.api| |dateFormat|Specify the format pattern of date as a string| |null| |dateLibrary|Option. Date library to use|
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index b11022c8633..15ab35ba4eb 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 32e83edba4c..efb3e265c27 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |basePackage|base package for java source code| |null| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 3f2318a8622..65ae38fc1ac 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |basePackage|base package for generated code| |org.openapitools| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |configPackage|configuration package for generated code| |org.openapitools.configuration| |controllerOnly|Whether to generate only API interface stubs without the server files.| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 5b579a5aa70..019efb9117a 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 2d00e598ba0..3a721083c20 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 987772f131a..d5e12fe3f3b 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/java.md b/docs/generators/java.md index 2427013b0e2..1cdeb245262 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |asyncNative|If true, async handlers will be used, instead of the sync version| |false| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false| |configKey|Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.| |null| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 8c6eb15e7c8..6cd328248a4 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 5e8f593a1fa..72cb6f71bcb 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index b68220e9063..e1778d3101b 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 6e77fb11f91..e54504b1ca2 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 0797cda9618..73bf0d8f6b2 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index b0e66a64f86..726c44cd45c 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index ec6f9b3ae87..aa92d499db2 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 90038fb4ecd..84aea15c97e 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| |developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index ee8399a2a4c..1b25cca82d3 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |apiSuffix|suffix for api classes| |Api| |artifactId|Generated artifact id (name of jar).| |kotlin-server| |artifactVersion|Generated artifact's package version.| |1.0.0| diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index a7de5eea623..cf81038ed36 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |annotationLibrary|Select the complementary documentation annotation library.|
**none**
Do not annotate Model and Api with complementary annotations.
**swagger1**
Annotate Model and Api using the Swagger Annotations 1.x library.
**swagger2**
Annotate Model and Api using the Swagger Annotations 2.x library.
|swagger2| |apiPackage|api package for generated code| |org.openapitools.api| |apiSuffix|suffix for api classes| |Api| diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 7a25d890a72..4bd4958a90a 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |apiSuffix|suffix for api classes| |Api| |artifactId|Generated artifact id (name of jar).| |null| |artifactVersion|Generated artifact's package version.| |1.0.0| diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 7f562302f28..4c6b25ad394 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -18,6 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |apiSuffix|suffix for api classes| |Api| |artifactId|Generated artifact id (name of jar).| |kotlin-client| |artifactVersion|Generated artifact's package version.| |1.0.0| @@ -27,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |idea|Add IntellJ Idea plugin and mark Kotlin main and test folders as source folders.| |false| -|library|Library template (sub-template) to use|
**jvm-ktor**
Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).
**jvm-okhttp4**
[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
**jvm-okhttp3**
Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
**jvm-retrofit2**
Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
**multiplatform**
Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.
**jvm-volley**
Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9
|jvm-okhttp4| +|library|Library template (sub-template) to use|
**jvm-ktor**
Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).
**jvm-okhttp4**
[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
**jvm-okhttp3**
Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
**jvm-retrofit2**
Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
**multiplatform**
Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.
**jvm-volley**
Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9
**jvm-vertx**
Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.
|jvm-okhttp4| |modelMutable|Create mutable models| |false| |moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false| |omitGradlePluginVersions|Whether to declare Gradle plugin versions in build files.| |false| diff --git a/docs/generators/ktorm-schema.md b/docs/generators/ktorm-schema.md index b4b5b1b6162..f279a112e66 100644 --- a/docs/generators/ktorm-schema.md +++ b/docs/generators/ktorm-schema.md @@ -19,6 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |addSurrogateKey|Adds the surrogate key for all models that don't already have a primary key (named by the above convention)| |false| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |artifactId|Generated artifact id (name of jar).| |ktorm| |artifactVersion|Generated artifact's package version.| |1.0.0| |defaultDatabaseName|Default database name for all queries| |sqlite.db| diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index 7e88dbc2cf3..2200cadf241 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -33,7 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |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| -|library|HTTP library template (sub-template) to use|
**faraday**
Faraday (https://github.com/lostisland/faraday) (Beta support)
**typhoeus**
Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)
|typhoeus| +|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| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 4abe7440838..9d28e7915e7 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |basePackage|base package (invokerPackage) for generated code| |org.openapitools| |bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| |booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |configPackage|configuration package for generated code| |org.openapitools.configuration| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| |delegatePattern|Whether to generate the server files using the delegate pattern| |false| @@ -66,6 +67,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |performBeanValidation|Use Bean Validation Impl. to perform BeanValidation| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reactive|wrap responses in Mono/Flux Reactor types (spring-boot only)| |false| +|requestMappingMode|Where to generate the class level @RequestMapping annotation.|
**api_interface**
Generate the @RequestMapping annotation on the generated Api Interface.
**controller**
Generate the @RequestMapping annotation on the generated Api Controller Implementation.
**none**
Do not add a class level @RequestMapping annotation.
|controller| |responseWrapper|wrap the responses in given type (Future, Callable, CompletableFuture,ListenableFuture, DeferredResult, RxObservable, RxSingle or fully qualified type)| |null| |returnSuccessCode|Generated server returns 2xx code| |false| |scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| diff --git a/docs/generators/typescript.md b/docs/generators/typescript.md index be714cbd096..2a0df3ca3ab 100644 --- a/docs/generators/typescript.md +++ b/docs/generators/typescript.md @@ -87,6 +87,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • char
  • class
  • const
  • +
  • constructor
  • continue
  • debugger
  • default
  • diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt index 82fe7e761e8..a610baa80e6 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt @@ -21,6 +21,7 @@ import org.gradle.api.GradleException import org.gradle.api.provider.Property import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.Internal import org.gradle.api.tasks.Optional @@ -98,7 +99,8 @@ open class GenerateTask : DefaultTask() { * The template directory holding a custom template. */ @Optional - @Input + @InputDirectory + @PathSensitive(PathSensitivity.RELATIVE) val templateDir = project.objects.property() /** @@ -122,7 +124,8 @@ open class GenerateTask : DefaultTask() { * Supported options can be different for each language. Run config-help -g {generator name} command for language specific config options. */ @Optional - @Input + @InputFile + @PathSensitive(PathSensitivity.RELATIVE) val configFile = project.objects.property() /** @@ -320,7 +323,8 @@ open class GenerateTask : DefaultTask() { * Specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation. */ @Optional - @Input + @InputFile + @PathSensitive(PathSensitivity.RELATIVE) val ignoreFileOverride = project.objects.property() /** diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt new file mode 100644 index 00000000000..2f573c94a11 --- /dev/null +++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt @@ -0,0 +1,200 @@ +package org.openapitools.generator.gradle.plugin + +import org.gradle.testkit.runner.TaskOutcome +import org.testng.annotations.BeforeMethod +import org.testng.annotations.DataProvider +import org.testng.annotations.Test +import java.io.File +import kotlin.test.assertEquals + +class GenerateTaskFromCacheTest : TestBase() { + + private lateinit var buildCacheDir: File + private lateinit var projectDir1: File + private lateinit var projectDir2: File + + @BeforeMethod + override fun before() { + initialize() + buildCacheDir = temp.resolve("buildCacheDir").apply { mkdir() } + projectDir1 = temp.resolve("projectDir1").apply { mkdir() } + projectDir2 = temp.resolve("projectDir2").apply { mkdir() } + } + + @DataProvider(name = "gradle_version_provider") + private fun gradleVersionProvider(): Array> = arrayOf(arrayOf("6.9.2"), arrayOf("7.5.1")) + + // inputSpec tests + + private val inputSpecExtensionContents = """ + generatorName = "kotlin" + inputSpec = file("spec.yaml").absolutePath + """.trimIndent() + + @Test(dataProvider = "gradle_version_provider") + fun `inputSpec - same directory - openApiGenerate task output should come from cache`(gradleVersion: String) { + runCacheabilityTestUsingSameDirectory(gradleVersion, inputSpecExtensionContents) + } + + @Test(dataProvider = "gradle_version_provider") + fun `inputSpec - different directory - openApiGenerate task output should come from cache`(gradleVersion: String) { + runCacheabilityTestUsingDifferentDirectories(gradleVersion, inputSpecExtensionContents) + } + + // templateDir tests + + private val templateDirExtensionContents = """ + generatorName = "kotlin" + inputSpec = file("spec.yaml").absolutePath + templateDir = file("templateDir").absolutePath + """.trimIndent() + + private fun initializeTemplateDirTest() { + projectDir1.resolve("templateDir").mkdir() + } + + @Test(dataProvider = "gradle_version_provider") + fun `templateDir - same directory - openApiGenerate task output should come from cache`(gradleVersion: String) { + initializeTemplateDirTest() + runCacheabilityTestUsingSameDirectory(gradleVersion, templateDirExtensionContents) + } + + @Test(dataProvider = "gradle_version_provider") + fun `templateDir - different directory - openApiGenerate task output should come from cache`(gradleVersion: String) { + initializeTemplateDirTest() + runCacheabilityTestUsingDifferentDirectories(gradleVersion, templateDirExtensionContents) + } + + // configFile tests + + private val configFileExtensionContents = """ + generatorName = "kotlin" + inputSpec = file("spec.yaml").absolutePath + configFile = file("configFile").absolutePath + """.trimIndent() + + private fun initializeConfigFileTest() { + val configFile = projectDir1.resolve("configFile") + configFile.createNewFile() + configFile.writeText("""{"foo":"bar"}""") + } + + @Test(dataProvider = "gradle_version_provider") + fun `configFile - same directory - openApiGenerate task output should come from cache`(gradleVersion: String) { + initializeConfigFileTest() + runCacheabilityTestUsingSameDirectory(gradleVersion, configFileExtensionContents) + } + + @Test(dataProvider = "gradle_version_provider") + fun `configFile - different directory - openApiGenerate task output should come from cache`(gradleVersion: String) { + initializeConfigFileTest() + runCacheabilityTestUsingDifferentDirectories(gradleVersion, configFileExtensionContents) + } + + // ignoreFileOverride tests + + private val ignoreFileOverrideExtensionContents = """ + generatorName = "kotlin" + inputSpec = file("spec.yaml").absolutePath + ignoreFileOverride = file(".openapi-generator-ignore").absolutePath + """.trimIndent() + + private fun initializeIgnoreFileTest() { + projectDir1.resolve(".openapi-generator-ignore").createNewFile() + } + + @Test(dataProvider = "gradle_version_provider") + fun `ignoreFileOverride - same directory - openApiGenerate task output should come from cache`(gradleVersion: String) { + initializeIgnoreFileTest() + runCacheabilityTestUsingSameDirectory(gradleVersion, ignoreFileOverrideExtensionContents) + } + + @Test(dataProvider = "gradle_version_provider") + fun `ignoreFileOverride - different directory - openApiGenerate task output should come from cache`(gradleVersion: String) { + initializeIgnoreFileTest() + runCacheabilityTestUsingDifferentDirectories(gradleVersion, ignoreFileOverrideExtensionContents) + } + + // Helper methods & test fixtures + + private fun runCacheabilityTestUsingSameDirectory(gradleVersion: String, extensionContents: String) { + // Arrange + withProject(extensionContents) + + // Act + val result1 = build { + withProjectDir(projectDir1) + withArguments("--build-cache", "clean", "openApiGenerate") + withGradleVersion(gradleVersion) + } + + val expectedRelativeFilePathSet = projectDir1.toRelativeFilePathSet() + + val result2 = build { + withProjectDir(projectDir1) + withArguments("--build-cache", "clean", "openApiGenerate") + withGradleVersion(gradleVersion) + } + + // Assert + assertEquals(TaskOutcome.SUCCESS, result1.task(":openApiGenerate")?.outcome) + assertEquals(TaskOutcome.FROM_CACHE, result2.task(":openApiGenerate")?.outcome) + assertEquals(expectedRelativeFilePathSet, projectDir1.toRelativeFilePathSet()) + } + + private fun runCacheabilityTestUsingDifferentDirectories(gradleVersion: String, extensionContents: String) { + // Arrange + withProject(extensionContents) + projectDir1.copyRecursively(projectDir2) + + // Act + val result1 = build { + withProjectDir(projectDir1) + withArguments("--build-cache", "clean", "openApiGenerate") + withGradleVersion(gradleVersion) + } + + val result2 = build { + withProjectDir(projectDir2) + withArguments("--build-cache", "clean", "openApiGenerate") + withGradleVersion(gradleVersion) + } + + // Assert + assertEquals(TaskOutcome.SUCCESS, result1.task(":openApiGenerate")?.outcome) + assertEquals(TaskOutcome.FROM_CACHE, result2.task(":openApiGenerate")?.outcome) + assertEquals(projectDir1.toRelativeFilePathSet(), projectDir2.toRelativeFilePathSet()) + } + + private fun File.toRelativeFilePathSet() = + resolve("build").walk().map { it.toRelativeString(resolve("build")) }.toSet() + + private fun withProject(extensionContents: String) { + val settingsContents = """ + buildCache { + local { + directory = file("${buildCacheDir.toURI()}") + } + } + rootProject.name = "openapi-generator" + """.trimIndent() + val buildContents = """ + plugins { + id 'base' + id 'org.openapi.generator' + } + openApiGenerate { + $extensionContents + } + """.trimIndent() + val projectFiles = mapOf( + "spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0.yaml")!! + ) + withProject( + projectDir = projectDir1, + settingsContents = settingsContents, + buildContents = buildContents, + projectFiles = projectFiles + ) + } +} diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt new file mode 100644 index 00000000000..8510135b0d1 --- /dev/null +++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt @@ -0,0 +1,173 @@ +package org.openapitools.generator.gradle.plugin + +import org.gradle.testkit.runner.TaskOutcome +import org.testng.annotations.DataProvider +import org.testng.annotations.Test +import java.io.File +import kotlin.test.assertEquals + +class GenerateTaskUpToDateTest : TestBase() { + + @DataProvider(name = "gradle_version_provider") + private fun gradleVersionProvider(): Array> = arrayOf(arrayOf("6.9.2"), arrayOf("7.5.1")) + + // inputSpec tests + + private val inputSpecExtensionContents = """ + generatorName = "kotlin" + inputSpec = file("spec.yaml").absolutePath + """.trimIndent() + + @Test(dataProvider = "gradle_version_provider") + fun `inputSpec - no file changes - should be up-to-date`(gradleVersion: String) { + runShouldBeUpToDateTest(gradleVersion, inputSpecExtensionContents) + } + + @Test(dataProvider = "gradle_version_provider") + fun `inputSpec - has file changes - should execute`(gradleVersion: String) { + runShouldExecuteTest(gradleVersion, inputSpecExtensionContents) { + val inputSpec = File(temp, "spec.yaml") + val newContents = inputSpec.readText().replace("version: 1.0.0", "version: 1.0.1") + inputSpec.writeText(newContents) + } + } + + // templateDir tests + + private val templateDirExtensionContents = """ + generatorName = "kotlin" + inputSpec = file("spec.yaml").absolutePath + templateDir = file("templateDir").absolutePath + """.trimIndent() + + private fun initializeTemplateDirTest(): File { + val templateDir = temp.resolve("templateDir") + templateDir.mkdir() + return templateDir.resolve("templateFile").apply { writeText("contents") } + } + + @Test(dataProvider = "gradle_version_provider") + fun `templateDir - no file changes - should be up-to-date`(gradleVersion: String) { + initializeTemplateDirTest() + runShouldBeUpToDateTest(gradleVersion, templateDirExtensionContents) + } + + @Test(dataProvider = "gradle_version_provider") + fun `templateDir - has file changes - should execute`(gradleVersion: String) { + val templateFile = initializeTemplateDirTest() + runShouldExecuteTest(gradleVersion, templateDirExtensionContents) { + templateFile.writeText("new contents") + } + } + + // configFile tests + + private val configFileExtensionContents = """ + generatorName = "kotlin" + inputSpec = file("spec.yaml").absolutePath + configFile = file("configFile").absolutePath + """.trimIndent() + + private fun initializeConfigFileTest(): File { + return temp.resolve("configFile").apply { writeText("""{"foo":"bar"}""") } + } + + @Test(dataProvider = "gradle_version_provider") + fun `configFile - no file changes - should be up-to-date`(gradleVersion: String) { + initializeConfigFileTest() + runShouldBeUpToDateTest(gradleVersion, configFileExtensionContents) + } + + @Test(dataProvider = "gradle_version_provider") + fun `configFile - has file changes - should execute`(gradleVersion: String) { + val configFile = initializeConfigFileTest() + runShouldExecuteTest(gradleVersion, configFileExtensionContents) { + configFile.writeText("""{"foo":"baz"}""") + } + } + + // ignoreFileOverride tests + + private val ignoreFileOverrideExtensionContents = """ + generatorName = "kotlin" + inputSpec = file("spec.yaml").absolutePath + ignoreFileOverride = file(".openapi-generator-ignore").absolutePath + """.trimIndent() + + private fun initializeIgnoreFileTest(): File { + return temp.resolve(".openapi-generator-ignore").apply { writeText(".some_file_to_ignore") } + } + + @Test(dataProvider = "gradle_version_provider") + fun `ignoreFileOverride - no file changes - should be up-to-date`(gradleVersion: String) { + initializeIgnoreFileTest() + runShouldBeUpToDateTest(gradleVersion, ignoreFileOverrideExtensionContents) + } + + @Test(dataProvider = "gradle_version_provider") + fun `ignoreFileOverride - has file changes - should execute`(gradleVersion: String) { + val ignoreFileOverride = initializeIgnoreFileTest() + runShouldExecuteTest(gradleVersion, ignoreFileOverrideExtensionContents) { + ignoreFileOverride.writeText(".new_file_to_ignore") + } + } + + // Helper methods & test fixtures + + private fun runShouldBeUpToDateTest(gradleVersion: String, extensionContents: String) { + // Arrange + withProject(extensionContents) + + // Act + val result1 = build { + withArguments("clean", "openApiGenerate") + withGradleVersion(gradleVersion) + } + + val result2 = build { + withArguments("openApiGenerate") + withGradleVersion(gradleVersion) + } + + // Assert + assertEquals(TaskOutcome.SUCCESS, result1.task(":openApiGenerate")?.outcome) + assertEquals(TaskOutcome.UP_TO_DATE, result2.task(":openApiGenerate")?.outcome) + } + + private fun runShouldExecuteTest(gradleVersion: String, extensionContents: String, action: () -> Unit) { + // Arrange + withProject(extensionContents) + + // Act + val result1 = build { + withArguments("clean", "openApiGenerate") + withGradleVersion(gradleVersion) + } + + action() + + val result2 = build { + withArguments("openApiGenerate") + withGradleVersion(gradleVersion) + } + + // Assert + assertEquals(TaskOutcome.SUCCESS, result1.task(":openApiGenerate")?.outcome) + assertEquals(TaskOutcome.SUCCESS, result2.task(":openApiGenerate")?.outcome) + } + + private fun withProject(extensionContents: String) { + val buildContents = """ + plugins { + id 'base' + id 'org.openapi.generator' + } + openApiGenerate { + $extensionContents + } + """.trimIndent() + File(temp, "build.gradle").writeText(buildContents) + File(javaClass.classLoader.getResource("specs/petstore-v3.0.yaml")!!.toURI()) + .copyTo(File(temp, "spec.yaml")) + } +} diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/TestBase.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/TestBase.kt index c676686db50..b7abfb5d718 100644 --- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/TestBase.kt +++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/TestBase.kt @@ -1,5 +1,6 @@ package org.openapitools.generator.gradle.plugin +import org.gradle.testkit.runner.GradleRunner import org.testng.annotations.AfterMethod import org.testng.annotations.BeforeMethod import java.io.File @@ -10,7 +11,11 @@ abstract class TestBase { protected open lateinit var temp: File @BeforeMethod - protected fun before() { + protected open fun before() { + initialize() + } + + protected fun initialize() { temp = createTempDirectory(javaClass.simpleName).toFile() temp.deleteOnExit() } @@ -20,12 +25,28 @@ abstract class TestBase { temp.deleteRecursively() } - protected fun withProject(buildContents: String, projectFiles: Map = mapOf()) { - File(temp, "build.gradle").writeText(buildContents) + protected fun withProject( + buildContents: String, + projectFiles: Map = mapOf(), + projectDir: File? = temp, + settingsContents: String? = null + ) { + File(projectDir, "build.gradle").writeText(buildContents) + if (!settingsContents.isNullOrEmpty()) { + File(projectDir, "settings.gradle").writeText(settingsContents) + } projectFiles.forEach { entry -> - val target = File(temp, entry.key) + val target = File(projectDir, entry.key) entry.value.copyTo(target.outputStream()) } } + + protected fun build(configure: GradleRunner.() -> Unit = {}) = + GradleRunner.create() + .withProjectDir(temp) + .withPluginClasspath() + .forwardOutput() + .apply(configure) + .build()!! } \ No newline at end of file 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 da8dd1cc914..edea61cc879 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 @@ -147,7 +147,7 @@ com.github.scribejava scribejava-apis - 6.9.0 + 8.3.1 org.tomitribe diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index f8d3fa08301..3d04d22fb6e 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -377,7 +377,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson.version} + ${jackson-databind.version} com.fasterxml.jackson.datatype 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 d6eef2a4222..0159ca2c8da 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 @@ -90,7 +90,7 @@ public class DefaultCodegen implements CodegenConfig { // A cache of sanitized words. The sanitizeName() method is invoked many times with the same // arguments, this cache is used to optimized performance. - private static Cache sanitizedNameCache; + private static final Cache sanitizedNameCache; private static final String xSchemaTestExamplesKey = "x-schema-test-examples"; private static final String xSchemaTestExamplesRefPrefix = "#/components/x-schema-test-examples/"; protected static Schema falseSchema; @@ -161,9 +161,9 @@ public class DefaultCodegen implements CodegenConfig { protected Set reservedWords; protected Set languageSpecificPrimitives = new HashSet<>(); protected Map importMapping = new HashMap<>(); - // a map to store the mappping between a schema and the new one + // a map to store the mapping between a schema and the new one protected Map schemaMapping = new HashMap<>(); - // a map to store the mappping between inline schema and the name provided by the user + // a map to store the mapping between inline schema and the name provided by the user protected Map inlineSchemaNameMapping = new HashMap<>(); // a map to store the inline schema naming conventions protected Map inlineSchemaNameDefault = new HashMap<>(); @@ -3715,7 +3715,7 @@ public class DefaultCodegen implements CodegenConfig { } else { property.openApiType = p.getType(); } - property.nameInCamelCase = camelize(property.name, false); + property.nameInCamelCase = camelize(property.name); property.nameInSnakeCase = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, property.nameInCamelCase); property.description = escapeText(p.getDescription()); property.unescapedDescription = p.getDescription(); 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 ef684023d35..40ebf90595a 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 @@ -903,7 +903,7 @@ public class InlineModelResolver { addGenerated(name, schema); openAPI.getComponents().addSchemas(name, schema); if (!name.equals(schema.getTitle()) && !inlineSchemaNameMappingValues.contains(name)) { - LOGGER.info("Inline schema created as {}. To have complete control of the model name, set the `title` field or use the inlineSchemaNameMapping option (--inline-schema-name-mapping in CLI).", name); + LOGGER.info("Inline schema created as {}. To have complete control of the model name, set the `title` field or use the inlineSchemaNameMapping option (--inline-schema-name-mappings in CLI).", name); } uniqueNames.add(name); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java index 2965605fd3c..dd67f9f4b57 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java @@ -44,6 +44,7 @@ import org.slf4j.LoggerFactory; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; abstract public class AbstractAdaCodegen extends DefaultCodegen implements CodegenConfig { @@ -826,7 +827,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg // method with only the scope that it requires. We have to create a new auth method // instance because the original object must not be modified. List opScopes = (scopes == null) ? null : scopes.get(authMethod.name); - authMethod.name = camelize(sanitizeName(authMethod.name), true); + authMethod.name = camelize(sanitizeName(authMethod.name), LOWERCASE_FIRST_LETTER); if (opScopes != null) { CodegenSecurity opSecurity = new CodegenSecurity(); opSecurity.name = authMethod.name; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java index 8f96a4bd34e..d64a2d56714 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java @@ -33,6 +33,7 @@ import org.slf4j.LoggerFactory; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public abstract class AbstractApexCodegen extends DefaultCodegen implements CodegenConfig { @@ -111,7 +112,7 @@ public abstract class AbstractApexCodegen extends DefaultCodegen implements Code // camelize (lower first character) the variable name // pet_id => petId - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved word or word starting with number, append _ if (isReservedWord(name) || name.matches("^\\d.*")) { @@ -422,11 +423,11 @@ public abstract class AbstractApexCodegen extends DefaultCodegen implements Code throw new RuntimeException("Empty method/operation name (operationId) not allowed"); } - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } 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 4281abea4fe..610322f0cf4 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 @@ -41,6 +41,7 @@ import java.io.IOException; import java.io.Writer; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public abstract class AbstractCSharpCodegen extends DefaultCodegen implements CodegenConfig { @@ -521,6 +522,16 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co property.isMap = composedProperty.isMap; property.isContainer = composedProperty.isContainer; } + + // 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 + ">"); + property.dataType = property.datatypeWithEnum; + } + if (property.datatypeWithEnum.contains("Dictionary>") && property.items != null) { + property.datatypeWithEnum = property.datatypeWithEnum.replace("Dictionary>", property.items.datatypeWithEnum + ">"); + property.dataType = property.datatypeWithEnum; + } } @Override @@ -964,7 +975,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co // camelize(lower) the variable name // pet_id => petId - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved word or word starting with number, append _ if (isReservedWord(name) || name.matches("^\\d.*")) { 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 5559d7f3ebe..11495fd7672 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 @@ -28,6 +28,7 @@ import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.*; public abstract class AbstractDartCodegen extends DefaultCodegen { @@ -373,7 +374,7 @@ public abstract class AbstractDartCodegen extends DefaultCodegen { // camelize (lower first character) the variable name // pet_id => petId - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); if (name.matches("^\\d.*")) { name = "n" + name; @@ -721,18 +722,18 @@ public abstract class AbstractDartCodegen extends DefaultCodegen { public String toOperationId(String operationId) { operationId = super.toOperationId(operationId); - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } // operationId starts with a number if (operationId.matches("^\\d.*")) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, newOperationId); operationId = newOperationId; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java index 5e179068c5d..112861cbb8f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java @@ -34,6 +34,7 @@ import org.slf4j.LoggerFactory; import java.util.*; +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; @@ -343,7 +344,7 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co throw new RuntimeException("Empty method/operation name (operationId) not allowed"); } - String sanitizedOperationId = camelize(sanitizeName(operationId), true); + String sanitizedOperationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(sanitizedOperationId)) { @@ -354,7 +355,7 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co // operationId starts with a number if (operationId.matches("^\\d.*")) { LOGGER.warn(operationId + " (starting with a number) cannot be used as method sname. Renamed to " + camelize("call_" + operationId), true); - sanitizedOperationId = camelize("call_" + sanitizedOperationId, true); + sanitizedOperationId = camelize("call_" + sanitizedOperationId, LOWERCASE_FIRST_LETTER); } // method name from updateSomething to update_Something. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java index b8a44efe931..0b66281495b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractFSharpCodegen.java @@ -38,6 +38,7 @@ import java.io.File; import java.io.IOException; import java.util.*; +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; @@ -661,7 +662,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: @@ -707,7 +708,7 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co // camelize(lower) the variable name // pet_id => petId - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved word or word starting with number, append _ if (isReservedWord(name) || name.matches("^\\d.*")) { 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 e024a49f143..d436a01c42f 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 @@ -34,6 +34,7 @@ import java.io.File; import java.io.IOException; import java.util.*; +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; @@ -232,7 +233,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege // params should be lowerCamelCase. E.g. "person Person", instead of // "Person Person". // - name = camelize(toVarName(name), true); + name = camelize(toVarName(name), LOWERCASE_FIRST_LETTER); // REVISIT: Actually, for idiomatic go, the param name should // really should just be a letter, e.g. "p Person"), but we'll get @@ -626,11 +627,39 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege iterator.remove(); } - boolean addedTimeImport = false; - boolean addedOSImport = false; for (ModelMap m : objs.getModels()) { + boolean addedTimeImport = false; + boolean addedOSImport = false; CodegenModel model = m.getModel(); - for (CodegenProperty cp : model.vars) { + + List inheritedProperties = new ArrayList<>(); + if (model.getComposedSchemas() != null) { + if (model.getComposedSchemas().getAllOf() != null) { + inheritedProperties.addAll(model.getComposedSchemas().getAllOf()); + } + if (model.getComposedSchemas().getAnyOf() != null) { + inheritedProperties.addAll(model.getComposedSchemas().getAnyOf()); + } + if (model.getComposedSchemas().getOneOf() != null) { + inheritedProperties.addAll(model.getComposedSchemas().getOneOf()); + } + } + + List codegenProperties = new ArrayList<>(); + if(model.getIsModel() || model.getComposedSchemas() == null) { + // If the model is a model, use model.vars as it only + // contains properties the generated struct will own itself. + // If model is no model and it has no composed schemas use + // model.vars. + codegenProperties.addAll(model.vars); + } else { + // If the model is no model, but is a + // allOf, anyOf or oneOf, add all first level options + // from allOf, anyOf or oneOf. + codegenProperties.addAll(inheritedProperties); + } + + for (CodegenProperty cp : codegenProperties) { if (!addedTimeImport && ("time.Time".equals(cp.dataType) || (cp.items != null && "time.Time".equals(cp.items.dataType)))) { imports.add(createMapping("import", "time")); @@ -647,6 +676,11 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege imports.add(createMapping("import", "fmt")); } + // if oneOf contains "time.Time" type + if (!addedTimeImport && model.oneOf != null && model.oneOf.contains("time.Time")) { + imports.add(createMapping("import", "time")); + } + // if oneOf contains "null" type if (model.oneOf != null && !model.oneOf.isEmpty() && model.oneOf.contains("nil")) { model.isNullable = true; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java index 1966b054827..b72b574e89a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java @@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; +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; @@ -160,7 +161,7 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C if (name.matches("^[A-Z_]*$")) return name; - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved word or word starting with number, append _ if (isReservedWord(name)) @@ -326,7 +327,7 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C sanitizedOperationId = "call_" + sanitizedOperationId; } - return camelize(sanitizedOperationId, false); + return camelize(sanitizedOperationId); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index ea6fa237fb0..572575e0882 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 @@ -40,6 +40,7 @@ import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.utils.CamelizeOption; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -55,6 +56,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.StreamSupport; +import static org.openapitools.codegen.utils.CamelizeOption.*; import static org.openapitools.codegen.utils.StringUtils.*; public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig, @@ -81,6 +83,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String IMPLICIT_HEADERS = "implicitHeaders"; public static final String IMPLICIT_HEADERS_REGEX = "implicitHeadersRegex"; + public static final String CAMEL_CASE_DOLLAR_SIGN = "camelCaseDollarSign"; + public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi"; protected String dateLibrary = "java8"; @@ -130,6 +134,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code protected boolean implicitHeaders = false; protected String implicitHeadersRegex = null; + protected boolean camelCaseDollarSign = false; + private Map schemaKeyToModelNameCache = new HashMap<>(); public AbstractJavaCodegen() { @@ -262,6 +268,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library", this.openApiNullable)); cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); cliOptions.add(CliOption.newString(IMPLICIT_HEADERS_REGEX, "Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true")); + cliOptions.add(CliOption.newBoolean(CAMEL_CASE_DOLLAR_SIGN, "Fix camelCase when starting with $ sign. when true : $Value when false : $value")); cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC)); cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_ID_DESC)); @@ -549,6 +556,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code this.setImplicitHeadersRegex(additionalProperties.get(IMPLICIT_HEADERS_REGEX).toString()); } + if (additionalProperties.containsKey(CAMEL_CASE_DOLLAR_SIGN)) { + this.setCamelCaseDollarSign(Boolean.parseBoolean(additionalProperties.get(CAMEL_CASE_DOLLAR_SIGN).toString())); + } + if (!StringUtils.isEmpty(parentGroupId) && !StringUtils.isEmpty(parentArtifactId) && !StringUtils.isEmpty(parentVersion)) { additionalProperties.put("parentOverridden", true); } @@ -795,7 +806,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code // camelize (lower first character) the variable name // pet_id => petId - name = camelize(name, true); + if (camelCaseDollarSign) { + name = camelize(name, LOWERCASE_FIRST_CHAR); + } else { + name = camelize(name, LOWERCASE_FIRST_LETTER); + } // for reserved word or word starting with number, append _ if (isReservedWord(name) || name.matches("^\\d.*")) { @@ -1261,11 +1276,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code throw new RuntimeException("Empty method/operation name (operationId) not allowed"); } - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } @@ -1273,7 +1288,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code // operationId starts with a number if (operationId.matches("^\\d.*")) { LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + camelize("call_" + operationId), true); - operationId = camelize("call_" + operationId, true); + operationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); } return operationId; @@ -1902,6 +1917,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code this.implicitHeadersRegex = implicitHeadersRegex; } + public void setCamelCaseDollarSign(boolean camelCaseDollarSign) { + this.camelCaseDollarSign = camelCaseDollarSign; + } + @Override public String escapeQuotationMark(String input) { // remove " to avoid code injection @@ -1984,7 +2003,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code */ @Override public String getterAndSetterCapitalize(String name) { - boolean lowercaseFirstLetter = false; + CamelizeOption camelizeOption = UPPERCASE_FIRST_CHAR; if (name == null || name.length() == 0) { return name; } @@ -1996,9 +2015,9 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code // http://download.oracle.com/otn-pub/jcp/7224-javabeans-1.01-fr-spec-oth-JSpec/beans.101.pdf) // if (name.length() > 1 && Character.isLowerCase(name.charAt(0)) && Character.isUpperCase(name.charAt(1))) { - lowercaseFirstLetter = true; + camelizeOption = LOWERCASE_FIRST_LETTER; } - return camelize(name, lowercaseFirstLetter); + return camelize(name, camelizeOption); } @Override 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 bd3b2279d19..399e9f61f99 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 @@ -39,6 +39,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.*; public abstract class AbstractKotlinCodegen extends DefaultCodegen implements CodegenConfig { @@ -49,6 +50,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co public static final String MODEL_MUTABLE = "modelMutable"; public static final String MODEL_MUTABLE_DESC = "Create mutable models"; + public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "additionalModelTypeAnnotations"; private final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class); @@ -60,12 +62,12 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co protected String sourceFolder = "src/main/kotlin"; protected String testFolder = "src/test/kotlin"; + protected String resourcesFolder = "src/main/resources"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected boolean parcelizeModels = false; protected boolean serializableModel = false; - protected boolean needsDataClassBody = false; protected boolean nonPublicApi = false; @@ -76,7 +78,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co // ref: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-hash-map/ protected Set propertyAdditionalKeywords = new HashSet<>(Arrays.asList("entries", "keys", "size", "values")); - private Map schemaKeyToModelNameCache = new HashMap<>(); + private final Map schemaKeyToModelNameCache = new HashMap<>(); + protected List additionalModelTypeAnnotations = new LinkedList<>(); public AbstractKotlinCodegen() { super(); @@ -262,6 +265,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co cliOptions.add(new CliOption(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG_DESC)); cliOptions.add(CliOption.newBoolean(MODEL_MUTABLE, MODEL_MUTABLE_DESC, false)); + cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); } @Override @@ -398,6 +402,21 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar); } + @Override + public Map postProcessAllModels(Map objs) { + objs = super.postProcessAllModels(objs); + objs = super.updateAllModels(objs); + + if (!additionalModelTypeAnnotations.isEmpty()) { + for (String modelName : objs.keySet()) { + Map models = (Map) objs.get(modelName); + models.put(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, additionalModelTypeAnnotations); + } + } + + return objs; + } + @Override public ModelsMap postProcessModels(ModelsMap objs) { objs = super.postProcessModelsEnum(objs); @@ -506,6 +525,11 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co additionalProperties.put(CodegenConstants.NON_PUBLIC_API, nonPublicApi); } + if (additionalProperties.containsKey(ADDITIONAL_MODEL_TYPE_ANNOTATIONS)) { + String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_MODEL_TYPE_ANNOTATIONS).toString(); + this.setAdditionalModelTypeAnnotations(Arrays.asList(additionalAnnotationsList.trim().split("\\s*(;|\\r?\\n)\\s*"))); + } + additionalProperties.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, getSortParamsByRequiredFlag()); additionalProperties.put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, getSortModelPropertiesByRequiredFlag()); @@ -578,14 +602,6 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co this.nonPublicApi = nonPublicApi; } - public boolean isNeedsDataClassBody() { - return needsDataClassBody; - } - - public void setNeedsDataClassBody(boolean needsDataClassBody) { - this.needsDataClassBody = needsDataClassBody; - } - /** * Return the sanitized variable name for enum * @@ -610,7 +626,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co break; case camelCase: // NOTE: Removes hyphens and underscores - modified = camelize(modified, true); + modified = camelize(modified, LOWERCASE_FIRST_LETTER); break; case PascalCase: // NOTE: Removes hyphens and underscores @@ -673,9 +689,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co @Override public String toModelName(final String name) { // memoization - String origName = name; - if (schemaKeyToModelNameCache.containsKey(origName)) { - return schemaKeyToModelNameCache.get(origName); + if (schemaKeyToModelNameCache.containsKey(name)) { + return schemaKeyToModelNameCache.get(name); } // Allow for explicitly configured kotlin.* and java.* types @@ -695,9 +710,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co } String modifiedName = name.replaceAll("\\.", ""); - String sanitizedName = sanitizeKotlinSpecificNames(modifiedName); - String nameWithPrefixSuffix = sanitizedName; + String nameWithPrefixSuffix = sanitizeKotlinSpecificNames(modifiedName); if (!StringUtils.isEmpty(modelNamePrefix)) { // add '_' so that model name can be camelized correctly nameWithPrefixSuffix = modelNamePrefix + "_" + nameWithPrefixSuffix; @@ -726,8 +740,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co return modelName; } - schemaKeyToModelNameCache.put(origName, titleCase(modifiedName)); - return schemaKeyToModelNameCache.get(origName); + schemaKeyToModelNameCache.put(name, titleCase(modifiedName)); + return schemaKeyToModelNameCache.get(name); } /** @@ -742,19 +756,19 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co if (StringUtils.isEmpty(operationId)) throw new RuntimeException("Empty method/operation name (operationId) not allowed"); - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } // operationId starts with a number if (operationId.matches("^\\d.*")) { - LOGGER.warn(operationId + " (starting with a number) cannot be used as method sname. Renamed to " + camelize("call_" + operationId), true); - operationId = camelize("call_" + operationId, true); + LOGGER.warn(operationId + " (starting with a number) cannot be used as method sname. Renamed to " + camelize("call_" + operationId), LOWERCASE_FIRST_LETTER); + operationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); } return operationId; @@ -843,10 +857,9 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co @Override protected boolean needToImport(String type) { // provides extra protection against improperly trying to import language primitives and java types - boolean imports = !type.startsWith("kotlin.") && !type.startsWith("java.") && + return !type.startsWith("kotlin.") && !type.startsWith("java.") && !defaultIncludes.contains(type) && !languageSpecificPrimitives.contains(type) && !type.contains("."); - return imports; } @Override @@ -909,7 +922,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co public String toVarName(String name) { name = toVariableName(name); if (propertyAdditionalKeywords.contains(name)) { - return camelize("property_" + name, true); + return camelize("property_" + name, LOWERCASE_FIRST_LETTER); } else { return name; } @@ -938,7 +951,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co } // If name contains special chars -> replace them. - if ((name.chars().anyMatch(character -> specialCharReplacements.keySet().contains(String.valueOf((char) character))))) { + if ((name.chars().anyMatch(character -> specialCharReplacements.containsKey(String.valueOf((char) character))))) { List allowedCharacters = new ArrayList<>(); allowedCharacters.add("_"); allowedCharacters.add("$"); @@ -947,7 +960,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co // camelize (lower first character) the variable name // pet_id => petId - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved word or word starting with number or containing dollar symbol, escape it if (isReservedWord(name) || name.matches("(^\\d.*)|(.*[$].*)")) { @@ -1017,15 +1030,17 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co @Override public String toDefaultValue(Schema schema) { - Schema p = ModelUtils.getReferencedSchema(this.openAPI, schema); + Schema p = ModelUtils.getReferencedSchema(this.openAPI, schema); if (ModelUtils.isBooleanSchema(p)) { if (p.getDefault() != null) { return p.getDefault().toString(); } } else if (ModelUtils.isDateSchema(p)) { // TODO + return null; } else if (ModelUtils.isDateTimeSchema(p)) { // TODO + return null; } else if (ModelUtils.isNumberSchema(p)) { if (p.getDefault() != null) { return fixNumberValue(p.getDefault().toString(), p); @@ -1071,7 +1086,6 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co } return null; } - return null; } @@ -1082,7 +1096,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co @Override protected void updateModelForObject(CodegenModel m, Schema schema) { - /** + /* * we have a custom version of this function so we only set isMap to true if * ModelUtils.isMapSchema * In other generators, isMap is true for all type object schemas @@ -1105,4 +1119,12 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co // process 'additionalProperties' setAddProps(schema, m); } + + public List getAdditionalModelTypeAnnotations() { + return additionalModelTypeAnnotations; + } + + public void setAdditionalModelTypeAnnotations(final List additionalModelTypeAnnotations) { + this.additionalModelTypeAnnotations = additionalModelTypeAnnotations; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index 98fd8f92217..cdf154aefd8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -35,6 +35,9 @@ import java.io.IOException; import java.util.*; import java.util.regex.Pattern; import java.util.regex.Matcher; + +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; +import static org.openapitools.codegen.utils.CamelizeOption.UPPERCASE_FIRST_CHAR; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -413,9 +416,9 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg if ("camelCase".equals(variableNamingConvention)) { // return the name in camelCase style // phone_number => phoneNumber - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); } else if ("PascalCase".equals(variableNamingConvention)) { - name = camelize(name, false); + name = camelize(name, UPPERCASE_FIRST_CHAR); } else { // default to snake case // return the name in underscore style // PhoneNumber => phone_number @@ -542,17 +545,17 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, camelize(sanitizeName("call_" + operationId), true)); + LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, camelize(sanitizeName("call_" + operationId), LOWERCASE_FIRST_LETTER)); operationId = "call_" + operationId; } // operationId starts with a number if (operationId.matches("^\\d.*")) { - LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, camelize(sanitizeName("call_" + operationId), true)); + LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, camelize(sanitizeName("call_" + operationId), LOWERCASE_FIRST_LETTER)); operationId = "call_" + operationId; } - return camelize(sanitizeName(operationId), true); + return camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); } /** diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java index 5f0f932c8d9..88ae7be78fd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java @@ -313,7 +313,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho if (name == null || name.length() == 0) { return "DefaultController"; } - return camelize(name, false) + "Controller"; + return camelize(name) + "Controller"; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java index 9d8541fc641..3fa7e4c9368 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractScalaCodegen.java @@ -19,6 +19,7 @@ package org.openapitools.codegen.languages; import com.samskivert.mustache.Escapers; import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; @@ -27,15 +28,20 @@ import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.model.ModelsMap; +import org.openapitools.codegen.utils.CamelizeOption; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; import java.util.*; import static org.openapitools.codegen.languages.AbstractJavaCodegen.DATE_LIBRARY; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; +import static org.openapitools.codegen.utils.CamelizeOption.UPPERCASE_FIRST_CHAR; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -293,7 +299,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: @@ -527,7 +533,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { if (specialCharReplacements.containsKey(name)) { name = specialCharReplacements.get(name); } - String identifier = camelize(sanitizeName(name), true); + String identifier = camelize(sanitizeName(name), LOWERCASE_FIRST_LETTER); if (capitalized) { identifier = StringUtils.capitalize(identifier); } @@ -588,11 +594,11 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { throw new RuntimeException("Empty method/operation name (operationId) not allowed"); } - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } @@ -600,7 +606,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { // operationId starts with a number if (operationId.matches("^\\d.*")) { LOGGER.warn(operationId + " (starting with a number) cannot be used as method sname. Renamed to " + camelize("call_" + operationId), true); - operationId = camelize("call_" + operationId, true); + operationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); } return operationId; @@ -614,4 +620,32 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.SCALA; } + + protected static abstract class CustomLambda implements Mustache.Lambda { + @Override + public void execute(Template.Fragment frag, Writer out) throws IOException { + final StringWriter tempWriter = new StringWriter(); + frag.execute(tempWriter); + out.write(formatFragment(tempWriter.toString())); + } + + public abstract String formatFragment(String fragment); + } + + protected static class CamelizeLambda extends CustomLambda { + private final CamelizeOption option; + + public CamelizeLambda(boolean capitalizeFirst) { + if (capitalizeFirst) { + option = UPPERCASE_FIRST_CHAR; + } else { + option = LOWERCASE_FIRST_LETTER; + } + } + + @Override + public String formatFragment(String fragment) { + return camelize(fragment, option); + } + } } 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 91c7bb1accd..779a71ccf60 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 @@ -47,6 +47,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import static org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen.ParameterExpander.ParamStyle.*; +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; @@ -757,7 +758,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp throw new RuntimeException("Empty method name (operationId) not allowed"); } - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); operationId = toSafeIdentifier(operationId); return operationId; @@ -802,7 +803,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: @@ -820,7 +821,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: @@ -911,7 +912,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp case original: return name; case camelCase: - return camelize(underscore(name), true); + return camelize(underscore(name), LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(underscore(name)); case snake_case: diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java index b0bbe14c92e..597e94fd510 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java @@ -30,6 +30,7 @@ import java.io.File; import java.util.Arrays; import java.util.HashSet; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -267,7 +268,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi // camelize (lower first character) the variable name // pet_id => petId - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved word or word starting with number, append _ if (isReservedWord(name) || name.matches("^\\d.*")) { @@ -394,11 +395,11 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi throw new RuntimeException("Empty method name (operationId) not allowed"); } - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java index 65efb273c70..64980677c15 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java @@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.*; public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -807,7 +808,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { public String toOperationId(String operationId) { // rename to empty_method_name_1 (e.g.) if method name is empty if (StringUtils.isEmpty(operationId)) { - operationId = camelize("empty_method_name_" + emptyMethodNameCounter++, true); + operationId = camelize("empty_method_name_" + emptyMethodNameCounter++, LOWERCASE_FIRST_LETTER); LOGGER.warn("Empty method name (operationId) found. Renamed to {}", operationId); return operationId; } @@ -825,7 +826,7 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { operationId = "call_" + operationId; } - return camelize(sanitizeName(operationId), true); + return camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java index c0c49772095..16436597ffc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java @@ -32,6 +32,7 @@ import java.io.File; import java.io.IOException; import java.util.*; +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; @@ -733,19 +734,19 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize(sanitizeName("call_" + operationId), true); + String newOperationId = camelize(sanitizeName("call_" + operationId), LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } // operationId starts with a number if (operationId.matches("^\\d.*")) { - String newOperationId = camelize(sanitizeName("call_" + operationId), true); + String newOperationId = camelize(sanitizeName("call_" + operationId), LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } - return camelize(sanitizeName(operationId), true); + return camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); } @Override 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 6700545a65f..153d9b4b471 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 @@ -31,6 +31,7 @@ import java.io.File; import java.util.*; import static org.apache.commons.lang3.StringUtils.isEmpty; +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; @@ -835,7 +836,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: 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 82975676024..5275022545e 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 @@ -42,6 +42,7 @@ import java.util.Comparator; import java.util.List; import static org.apache.commons.lang3.StringUtils.isEmpty; +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; @@ -84,10 +85,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { private static FrameworkStrategy defaultFramework = FrameworkStrategy.NETSTANDARD_2_0; protected final Map frameworks; protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; - protected String clientPackage = "Org.OpenAPITools.Client"; + protected String clientPackage = "Client"; protected String authFolder = "Auth"; - protected String apiDocPath = "docs/"; - protected String modelDocPath = "docs/"; + protected String apiDocPath = "docs" + File.separator; + protected String modelDocPath = "docs" + File.separator; // Defines TargetFrameworkVersion in csproj files protected String targetFramework = defaultFramework.name; @@ -490,7 +491,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: @@ -547,6 +548,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { postProcessPattern(property.pattern, property.vendorExtensions); postProcessEmitDefaultValue(property.vendorExtensions); + // remove once https://github.com/OpenAPITools/openapi-generator/pull/13681 is merged if (GENERICHOST.equals(getLibrary())) { // all c# libraries should want this, but avoid breaking changes for now // a class cannot contain a property with the same name @@ -664,8 +666,6 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { setModelPackage("Model"); } - clientPackage = "Client"; - if (GENERICHOST.equals(getLibrary())) { setLibrary(GENERICHOST); additionalProperties.put("useGenericHost", true); @@ -679,7 +679,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { additionalProperties.put("useHttpClient", true); needsUriBuilder = true; } else { - throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only restsharp, httpclient are supported."); + throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only restsharp, httpclient, and generichost are supported."); } String inputFramework = (String) additionalProperties.getOrDefault(CodegenConstants.DOTNET_FRAMEWORK, defaultFramework.name); @@ -742,7 +742,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { final AtomicReference excludeTests = new AtomicReference<>(); syncBooleanProperty(additionalProperties, CodegenConstants.EXCLUDE_TESTS, excludeTests::set, false); - syncStringProperty(additionalProperties, "clientPackage", (s) -> { }, clientPackage); + syncStringProperty(additionalProperties, "clientPackage", this::setClientPackage, clientPackage); syncStringProperty(additionalProperties, CodegenConstants.API_PACKAGE, this::setApiPackage, apiPackage); syncStringProperty(additionalProperties, CodegenConstants.MODEL_PACKAGE, this::setModelPackage, modelPackage); @@ -809,6 +809,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { addTestInstructions(); } + public void setClientPackage(String clientPackage) { + this.clientPackage = clientPackage; + } + @Override public CodegenOperation fromOperation(String path, String httpMethod, diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java index 4d4495fda4d..e9b09f0acb9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java @@ -37,6 +37,7 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import static org.apache.commons.lang3.StringUtils.isEmpty; +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; @@ -415,7 +416,7 @@ public class CSharpNetCoreReducedClientCodegen extends AbstractCSharpCodegen { case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java index a60e1cdb6be..5c6381a0884 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java @@ -32,6 +32,7 @@ import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class CppTizenClientCodegen extends AbstractCppCodegen implements CodegenConfig { @@ -311,7 +312,7 @@ public class CppTizenClientCodegen extends AbstractCppCodegen implements Codegen } // add_pet_by_id => addPetById - return camelize(operationId, true); + return camelize(operationId, LOWERCASE_FIRST_LETTER); } /** * Output the Getter name for boolean property, e.g. getActive diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java index 09f7808f119..cec3f30a402 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java @@ -485,7 +485,7 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen { languageSpecificPrimitives.contains(type)) { return type; } else { - return modelNamePrefix + camelize(sanitizeName(type), false); + return modelNamePrefix + camelize(sanitizeName(type)); } } @@ -500,7 +500,7 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen { } //Unreal variable names are CamelCase - String camelCaseName = camelize(name, false); + String camelCaseName = camelize(name); //Avoid empty variable name at all costs if(!camelCaseName.isEmpty()) { @@ -527,7 +527,7 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen { @Override public String toApiName(String type) { - return modelNamePrefix + camelize(type, false) + "Api"; + return modelNamePrefix + camelize(type) + "Api"; } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java index 2bad546e9bd..bef91d6e735 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java @@ -84,27 +84,21 @@ public class CrystalClientCodegen extends DefaultCodegen { SecurityFeature.BasicAuth, SecurityFeature.BearerToken, SecurityFeature.ApiKey, - SecurityFeature.OAuth2_Implicit - )) + SecurityFeature.OAuth2_Implicit)) .excludeGlobalFeatures( GlobalFeature.XMLStructureDefinitions, GlobalFeature.Callbacks, GlobalFeature.LinkObjects, GlobalFeature.ParameterStyling, GlobalFeature.ParameterizedServer, - GlobalFeature.MultiServer - ) + GlobalFeature.MultiServer) .includeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) + SchemaSupportFeature.Polymorphism) .excludeParameterFeatures( - ParameterFeature.Cookie - ) + ParameterFeature.Cookie) .includeClientModificationFeatures( ClientModificationFeature.BasePath, - ClientModificationFeature.UserAgent - ) - ); + ClientModificationFeature.UserAgent)); generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.BETA) @@ -128,13 +122,14 @@ public class CrystalClientCodegen extends DefaultCodegen { apiTestTemplateFiles.put("api_test.mustache", ".cr"); // TODO support auto-generated doc - //modelDocTemplateFiles.put("model_doc.mustache", ".md"); - //apiDocTemplateFiles.put("api_doc.mustache", ".md"); + // modelDocTemplateFiles.put("model_doc.mustache", ".md"); + // apiDocTemplateFiles.put("api_doc.mustache", ".md"); // default HIDE_GENERATION_TIMESTAMP to true hideGenerationTimestamp = Boolean.TRUE; - // reserved word. Ref: https://github.com/crystal-lang/crystal/wiki/Crystal-for-Rubyists#available-keywords + // reserved word. Ref: + // https://github.com/crystal-lang/crystal/wiki/Crystal-for-Rubyists#available-keywords reservedWords = new HashSet<>( Arrays.asList( "abstract", "annotation", "do", "if", "nil?", "select", "union", @@ -146,8 +141,7 @@ public class CrystalClientCodegen extends DefaultCodegen { "break", "extend", "macro", "require", "true", "with", "case", "false", "module", "rescue", "type", "yield", "class", "for", "next", "responds_to?", "typeof", - "def", "fun", "nil", "return", "uninitialized") - ); + "def", "fun", "nil", "return", "uninitialized")); languageSpecificPrimitives.clear(); languageSpecificPrimitives.add("String"); @@ -180,6 +174,7 @@ public class CrystalClientCodegen extends DefaultCodegen { typeMapping.put("set", "Set"); typeMapping.put("map", "Hash"); typeMapping.put("object", "Object"); + typeMapping.put("AnyType", "Object"); typeMapping.put("file", "::File"); typeMapping.put("binary", "String"); typeMapping.put("ByteArray", "String"); @@ -194,29 +189,25 @@ public class CrystalClientCodegen extends DefaultCodegen { cliOptions.removeIf(opt -> CodegenConstants.MODEL_PACKAGE.equals(opt.getOpt()) || CodegenConstants.API_PACKAGE.equals(opt.getOpt())); - cliOptions.add(new CliOption(SHARD_NAME, "shard name (e.g. twitter_client"). - defaultValue("openapi_client")); + cliOptions.add(new CliOption(SHARD_NAME, "shard name (e.g. twitter_client").defaultValue("openapi_client")); - cliOptions.add(new CliOption(MODULE_NAME, "module name (e.g. TwitterClient"). - defaultValue("OpenAPIClient")); + cliOptions.add(new CliOption(MODULE_NAME, "module name (e.g. TwitterClient").defaultValue("OpenAPIClient")); cliOptions.add(new CliOption(SHARD_VERSION, "shard version.").defaultValue("1.0.0")); - cliOptions.add(new CliOption(SHARD_LICENSE, "shard license."). - defaultValue("unlicense")); + cliOptions.add(new CliOption(SHARD_LICENSE, "shard license.").defaultValue("unlicense")); - cliOptions.add(new CliOption(SHARD_HOMEPAGE, "shard homepage."). - defaultValue("http://org.openapitools")); + cliOptions.add(new CliOption(SHARD_HOMEPAGE, "shard homepage.").defaultValue("http://org.openapitools")); - cliOptions.add(new CliOption(SHARD_DESCRIPTION, "shard description."). - defaultValue("This shard maps to a REST API")); + cliOptions.add( + new CliOption(SHARD_DESCRIPTION, "shard description.").defaultValue("This shard maps to a REST API")); cliOptions.add(new CliOption(SHARD_AUTHOR, "shard author (only one is supported).")); cliOptions.add(new CliOption(SHARD_AUTHOR_EMAIL, "shard author email (only one is supported).")); - cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC). - defaultValue(Boolean.TRUE.toString())); + cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, + CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC).defaultValue(Boolean.TRUE.toString())); } @Override @@ -224,7 +215,8 @@ public class CrystalClientCodegen extends DefaultCodegen { super.processOpts(); if (StringUtils.isEmpty(System.getenv("CRYSTAL_POST_PROCESS_FILE"))) { - LOGGER.info("Hint: Environment variable 'CRYSTAL_POST_PROCESS_FILE' (optional) not defined. E.g. to format the source code, please try 'export CRYSTAL_POST_PROCESS_FILE=\"/usr/local/bin/crystal tool format\"' (Linux/Mac)"); + LOGGER.info( + "Hint: Environment variable 'CRYSTAL_POST_PROCESS_FILE' (optional) not defined. E.g. to format the source code, please try 'export CRYSTAL_POST_PROCESS_FILE=\"/usr/local/bin/crystal tool format\"' (Linux/Mac)"); } if (additionalProperties.containsKey(SHARD_NAME)) { @@ -313,12 +305,14 @@ public class CrystalClientCodegen extends DefaultCodegen { @Override public String apiFileFolder() { - return outputFolder + File.separator + srcFolder + File.separator + shardName + File.separator + apiPackage.replace("/", File.separator); + return outputFolder + File.separator + srcFolder + File.separator + shardName + File.separator + + apiPackage.replace("/", File.separator); } @Override public String modelFileFolder() { - return outputFolder + File.separator + srcFolder + File.separator + shardName + File.separator + modelPackage.replace("/", File.separator); + return outputFolder + File.separator + srcFolder + File.separator + shardName + File.separator + + modelPackage.replace("/", File.separator); } @Override @@ -364,7 +358,7 @@ public class CrystalClientCodegen extends DefaultCodegen { @Override public String toModelName(final String name) { String modelName; - modelName = sanitizeName(name); + modelName = sanitizeModelName(name); if (!StringUtils.isEmpty(modelNamePrefix)) { modelName = modelNamePrefix + "_" + modelName; @@ -393,6 +387,15 @@ public class CrystalClientCodegen extends DefaultCodegen { return camelize(modelName); } + public String sanitizeModelName(String modelName) { + String[] parts = modelName.split("::"); + ArrayList new_parts = new ArrayList(); + for (String part : parts) { + new_parts.add(sanitizeName(part)); + } + return String.join("::", new_parts); + } + @Override public String toModelFilename(String name) { return underscore(toModelName(name)); @@ -510,7 +513,8 @@ public class CrystalClientCodegen extends DefaultCodegen { // operationId starts with a number if (operationId.matches("^\\d.*")) { - LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, underscore(sanitizeName("call_" + operationId))); + LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, + underscore(sanitizeName("call_" + operationId))); operationId = "call_" + operationId; } @@ -609,7 +613,8 @@ public class CrystalClientCodegen extends DefaultCodegen { return objs; } - private String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps, HashMap processedModelMap) { + private String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps, + HashMap processedModelMap) { if (codegenParameter.isArray) { // array if (codegenParameter.items == null) { return "[]"; @@ -669,13 +674,15 @@ public class CrystalClientCodegen extends DefaultCodegen { if (modelMaps.containsKey(codegenParameter.dataType)) { return constructExampleCode(modelMaps.get(codegenParameter.dataType), modelMaps, processedModelMap); } else { - //LOGGER.error("Error in constructing examples. Failed to look up the model " + codegenParameter.dataType); + // LOGGER.error("Error in constructing examples. Failed to look up the model " + + // codegenParameter.dataType); return "TODO"; } } } - private String constructExampleCode(CodegenProperty codegenProperty, HashMap modelMaps, HashMap processedModelMap) { + private String constructExampleCode(CodegenProperty codegenProperty, HashMap modelMaps, + HashMap processedModelMap) { if (codegenProperty.isArray) { // array return "[" + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + "]"; } else if (codegenProperty.isMap) { @@ -735,14 +742,17 @@ public class CrystalClientCodegen extends DefaultCodegen { if (modelMaps.containsKey(codegenProperty.dataType)) { return constructExampleCode(modelMaps.get(codegenProperty.dataType), modelMaps, processedModelMap); } else { - //LOGGER.error("Error in constructing examples. Failed to look up the model " + codegenParameter.dataType); + // LOGGER.error("Error in constructing examples. Failed to look up the model " + + // codegenParameter.dataType); return "TODO"; } } } - private String constructExampleCode(CodegenModel codegenModel, HashMap modelMaps, HashMap processedModelMap) { - // break infinite recursion. Return, in case a model is already processed in the current context. + private String constructExampleCode(CodegenModel codegenModel, HashMap modelMaps, + HashMap processedModelMap) { + // break infinite recursion. Return, in case a model is already processed in the + // current context. String model = codegenModel.name; if (processedModelMap.containsKey(model)) { int count = processedModelMap.get(model); @@ -754,7 +764,8 @@ public class CrystalClientCodegen extends DefaultCodegen { throw new RuntimeException("Invalid count when constructing example: " + count); } } else if (codegenModel.isEnum) { - List> enumVars = (List>) codegenModel.allowableValues.get("enumVars"); + List> enumVars = (List>) codegenModel.allowableValues + .get("enumVars"); return moduleName + "::" + codegenModel.classname + "::" + enumVars.get(0).get("name"); } else if (codegenModel.oneOf != null && !codegenModel.oneOf.isEmpty()) { String subModel = (String) codegenModel.oneOf.toArray()[0]; @@ -766,7 +777,8 @@ public class CrystalClientCodegen extends DefaultCodegen { List propertyExamples = new ArrayList<>(); for (CodegenProperty codegenProperty : codegenModel.requiredVars) { - propertyExamples.add(codegenProperty.name + ": " + constructExampleCode(codegenProperty, modelMaps, processedModelMap)); + propertyExamples.add( + codegenProperty.name + ": " + constructExampleCode(codegenProperty, modelMaps, processedModelMap)); } String example = moduleName + "::" + toModelName(model) + ".new"; if (!propertyExamples.isEmpty()) { @@ -826,7 +838,8 @@ public class CrystalClientCodegen extends DefaultCodegen { LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); return "Date.parse(\"" + String.format(Locale.ROOT, localDate.toString(), "") + "\")"; } else if (p.getDefault() instanceof java.time.OffsetDateTime) { - return "Time.parse(\"" + String.format(Locale.ROOT, ((java.time.OffsetDateTime) p.getDefault()).atZoneSameInstant(ZoneId.systemDefault()).toString(), "") + "\")"; + return "Time.parse(\"" + String.format(Locale.ROOT, ((java.time.OffsetDateTime) p.getDefault()) + .atZoneSameInstant(ZoneId.systemDefault()).toString(), "") + "\")"; } else { return "\"" + escapeText((String.valueOf(p.getDefault()))) + "\""; } @@ -901,14 +914,16 @@ public class CrystalClientCodegen extends DefaultCodegen { Process p = Runtime.getRuntime().exec(command); int exitValue = p.waitFor(); if (exitValue != 0) { - try (InputStreamReader inputStreamReader = new InputStreamReader(p.getErrorStream(), StandardCharsets.UTF_8); - BufferedReader br = new BufferedReader(inputStreamReader)) { + try (InputStreamReader inputStreamReader = new InputStreamReader(p.getErrorStream(), + StandardCharsets.UTF_8); + BufferedReader br = new BufferedReader(inputStreamReader)) { StringBuilder sb = new StringBuilder(); String line; while ((line = br.readLine()) != null) { sb.append(line); } - LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb); + LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, + exitValue, sb); } } else { LOGGER.info("Successfully executed: {}", command); @@ -922,5 +937,7 @@ public class CrystalClientCodegen extends DefaultCodegen { } @Override - public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.CRYSTAL; } + public GeneratorLanguage generatorLanguage() { + return GeneratorLanguage.CRYSTAL; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java index 16f1a974895..89d2c4cbf04 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElmClientCodegen.java @@ -43,6 +43,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -187,11 +188,11 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { throw new RuntimeException("Empty method/operation name (operationId) not allowed"); } - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } @@ -199,7 +200,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { // operationId starts with a number if (operationId.matches("^\\d.*")) { LOGGER.warn(operationId + " (starting with a number) cannot be used as method sname. Renamed to " + camelize("call_" + operationId), true); - operationId = camelize("call_" + operationId, true); + operationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); } return operationId; @@ -226,7 +227,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig { @Override public String toVarName(String name) { - final String varName = camelize(name.replaceAll("[^a-zA-Z0-9_]", ""), true); + final String varName = camelize(name.replaceAll("[^a-zA-Z0-9_]", ""), LOWERCASE_FIRST_LETTER); return isReservedWord(varName) ? escapeReservedWord(name) : varName; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java index 2b89404ce7d..05eae90beec 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/FlashClientCodegen.java @@ -33,6 +33,7 @@ import java.util.EnumSet; import java.util.HashMap; import java.util.Locale; +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; @@ -297,7 +298,7 @@ public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig // underscore the variable name // petId => pet_id - name = camelize(dropDots(name), true); + name = camelize(dropDots(name), LOWERCASE_FIRST_LETTER); // for reserved word or word starting with number, append _ if (isReservedWord(name) || name.matches("^\\d.*")) { 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 e145e4a3855..6f3dae4915c 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 @@ -41,6 +41,7 @@ import java.io.IOException; import java.io.Writer; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class GoClientCodegen extends AbstractGoCodegen { @@ -392,7 +393,7 @@ public class GoClientCodegen extends AbstractGoCodegen { @Override public CodegenProperty fromProperty(String name, Schema p, boolean required) { CodegenProperty prop = super.fromProperty(name, p, required); - String cc = camelize(prop.name, true); + String cc = camelize(prop.name, LOWERCASE_FIRST_LETTER); if (isReservedWord(cc)) { cc = escapeReservedWord(cc); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index f728c766517..407e05a09af 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -43,6 +43,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; +import static org.openapitools.codegen.utils.CamelizeOption.UPPERCASE_FIRST_CHAR; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -1171,9 +1173,10 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC } public String toVarName(String prefix, String name) { - Boolean hasPrefix = !StringUtils.isBlank(prefix); + boolean hasPrefix = !StringUtils.isBlank(prefix); name = underscore(sanitizeName(name.replaceAll("-", "_"))); - name = camelize(name, !hasPrefix); + name = camelize(name, hasPrefix ? UPPERCASE_FIRST_CHAR : LOWERCASE_FIRST_LETTER); + if (hasPrefix) { return prefix + name; } else { @@ -1227,7 +1230,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC if (StringUtils.isEmpty(operationId)) { throw new RuntimeException("Empty method/operation name (operationId) not allowed"); } - operationId = escapeIdentifier("op", camelize(sanitizeName(operationId), true)); + operationId = escapeIdentifier("op", camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER)); return operationId; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java index 5bc339d774f..4296074ddd1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java @@ -35,6 +35,7 @@ import java.io.IOException; import java.util.*; import java.util.regex.Pattern; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class HaskellServantCodegen extends DefaultCodegen implements CodegenConfig { @@ -592,7 +593,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf op.vendorExtensions.put("x-client-type", joinStrings(" -> ", type)); op.vendorExtensions.put("x-form-name", "Form" + camelize(op.operationId)); for (CodegenParameter param : op.formParams) { - param.vendorExtensions.put("x-form-prefix", camelize(op.operationId, true)); + param.vendorExtensions.put("x-form-prefix", camelize(op.operationId, LOWERCASE_FIRST_LETTER)); } return op; } @@ -658,7 +659,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf } // From the model name, compute the prefix for the fields. - String prefix = camelize(model.classname, true); + String prefix = camelize(model.classname, LOWERCASE_FIRST_LETTER); for (CodegenProperty prop : model.vars) { prop.name = toVarName(prefix + camelize(fixOperatorChars(prop.name))); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java index d30093ce7c9..8b8c49076fc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellYesodServerCodegen.java @@ -37,6 +37,7 @@ import java.io.IOException; import java.util.*; import java.util.regex.Pattern; +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.dashize; @@ -571,7 +572,7 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen } // From the model name, compute the prefix for the fields. - String prefix = camelize(model.classname, true); + String prefix = camelize(model.classname, LOWERCASE_FIRST_LETTER); for (CodegenProperty prop : model.vars) { prop.name = toVarName(prefix + camelize(fixOperatorChars(prop.name))); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index c2b5ad4863a..fe85946ba88 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -44,6 +44,7 @@ import java.util.regex.Pattern; import static com.google.common.base.CaseFormat.LOWER_CAMEL; import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE; import static java.util.Collections.sort; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class JavaClientCodegen extends AbstractJavaCodegen @@ -762,7 +763,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen for (int i = 0; i < items.length; ++i) { if (items[i].matches("^\\{(.*)\\}$")) { // wrap in {} // camelize path variable - items[i] = "{" + camelize(items[i].substring(1, items[i].length() - 1), true) + "}"; + items[i] = "{" + camelize(items[i].substring(1, items[i].length() - 1), LOWERCASE_FIRST_LETTER) + "}"; } } op.path = StringUtils.join(items, "/"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java index 22bd809dde6..ac6ce1e43f7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPKMSTServerCodegen.java @@ -33,6 +33,7 @@ import java.io.File; import java.net.URL; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; /** @@ -512,7 +513,7 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen { title = title.substring(0, title.length() - 3); } - this.title = camelize(sanitizeName(title), true); + this.title = camelize(sanitizeName(title), LOWERCASE_FIRST_LETTER); } additionalProperties.put(TITLE, this.title); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java index 9de29a5ef90..04abfd95b93 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java @@ -34,6 +34,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { @@ -330,7 +331,7 @@ public class JavaPlayFrameworkCodegen extends AbstractJavaCodegen implements Bea Matcher match = pathVariableMatcher.matcher(operation.path); while (match.find()) { String completeMatch = match.group(); - String replacement = ":" + camelize(match.group(1), true); + String replacement = ":" + camelize(match.group(1), LOWERCASE_FIRST_LETTER); operation.path = operation.path.replace(completeMatch, replacement); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java index 686542b7617..e979a72b2c1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java @@ -40,6 +40,7 @@ import java.io.File; import java.io.IOException; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.*; public class JavascriptApolloClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -507,7 +508,7 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: @@ -840,18 +841,18 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod throw new RuntimeException("Empty method/operation name (operationId) not allowed"); } - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } // operationId starts with a number if (operationId.matches("^\\d.*")) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java index eac98040cc6..5d388308675 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java @@ -39,6 +39,7 @@ import java.io.File; import java.io.IOException; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.*; public class JavascriptClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -492,7 +493,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: @@ -825,18 +826,18 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo throw new RuntimeException("Empty method/operation name (operationId) not allowed"); } - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } // operationId starts with a number if (operationId.matches("^\\d.*")) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java index f93d32affc2..b0649d5a8a1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClosureAngularClientCodegen.java @@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -179,7 +180,7 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem // camelize the variable name // pet_id => PetId - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved word or word starting with number, append _ if (isReservedWord(name) || name.matches("^\\d.*")) @@ -287,11 +288,11 @@ public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implem throw new RuntimeException("Empty method/operation name (operationId) not allowed"); } - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize("call_" + operationId, true); + String newOperationId = camelize("call_" + operationId, LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java index afc56451f1c..c0dfa1c2e03 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java @@ -16,6 +16,7 @@ package org.openapitools.codegen.languages; +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.dashize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -708,7 +709,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: 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 6b9dd53321d..994b4b052cc 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 @@ -63,6 +63,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { protected static final String JVM_RETROFIT2 = "jvm-retrofit2"; protected static final String MULTIPLATFORM = "multiplatform"; protected static final String JVM_VOLLEY = "jvm-volley"; + protected static final String JVM_VERTX = "jvm-vertx"; public static final String USE_RX_JAVA = "useRxJava"; public static final String USE_RX_JAVA2 = "useRxJava2"; @@ -215,6 +216,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { supportedLibraries.put(JVM_RETROFIT2, "Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2."); supportedLibraries.put(MULTIPLATFORM, "Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1."); supportedLibraries.put(JVM_VOLLEY, "Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9"); + supportedLibraries.put(JVM_VERTX, "Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson."); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "Library template (sub-template) to use"); libraryOption.setEnum(supportedLibraries); @@ -441,6 +443,9 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { case MULTIPLATFORM: processMultiplatformLibrary(infrastructureFolder); break; + case JVM_VERTX: + processJVMVertXLibrary(infrastructureFolder); + break; default: break; } @@ -666,6 +671,22 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { supportingFiles.add(new SupportingFile("auth/OAuth.kt.mustache", authFolder, "OAuth.kt")); } + /** + * Process Vert.x client options + * + * @param infrastructureFolder infrastructure destination folder + */ + private void processJVMVertXLibrary(final String infrastructureFolder) { + supportingFiles.add(new SupportingFile("infrastructure/ApiAbstractions.kt.mustache", infrastructureFolder, "ApiAbstractions.kt")); + supportingFiles.add(new SupportingFile("infrastructure/ApiClient.kt.mustache", infrastructureFolder, "ApiClient.kt")); + supportingFiles.add(new SupportingFile("infrastructure/Errors.kt.mustache", infrastructureFolder, "Errors.kt")); + supportingFiles.add(new SupportingFile("infrastructure/ApiResponse.kt.mustache", infrastructureFolder, "ApiResponse.kt")); + addSupportingSerializerAdapters(infrastructureFolder); + + additionalProperties.put(JVM, true); + additionalProperties.put(JVM_VERTX, true); + } + private void processJVMOkHttpLibrary(final String infrastructureFolder) { commonJvmMultiplatformSupportingFiles(infrastructureFolder); addSupportingSerializerAdapters(infrastructureFolder); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java index 67a042da6b4..ffaef1dc137 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java @@ -131,7 +131,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files. This option is currently supported only when using jaxrs-spec library.").defaultValue(String.valueOf(interfaceOnly))); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations. This option is currently supported only when using jaxrs-spec library.", useBeanValidation)); - cliOptions.add(CliOption.newBoolean(USE_COROUTINES, "Whether to use the Coroutines. This option is currently supported only when using jaxrs-spec library.")); + cliOptions.add(CliOption.newBoolean(USE_COROUTINES, "Whether to use the Coroutines. This option is currently supported only when using jaxrs-spec library.", useCoroutines)); cliOptions.add(CliOption.newBoolean(RETURN_RESPONSE, "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.").defaultValue(String.valueOf(returnResponse))); } @@ -293,7 +293,6 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen implements BeanVa boolean generateApis = additionalProperties.containsKey(CodegenConstants.GENERATE_APIS) && (Boolean) additionalProperties.get(CodegenConstants.GENERATE_APIS); String packageFolder = (sourceFolder + File.separator + packageName).replace(".", File.separator); - String resourcesFolder = "src/main/resources"; // not sure this can be user configurable. supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerDeprecatedCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerDeprecatedCodegen.java index bbdf6064c02..d63faee75ac 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerDeprecatedCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerDeprecatedCodegen.java @@ -214,7 +214,6 @@ public class KotlinServerDeprecatedCodegen extends AbstractKotlinCodegen { boolean generateApis = additionalProperties.containsKey(CodegenConstants.GENERATE_APIS) && (Boolean) additionalProperties.get(CodegenConstants.GENERATE_APIS); String packageFolder = (sourceFolder + File.separator + packageName).replace(".", File.separator); - String resourcesFolder = "src/main/resources"; // not sure this can be user configurable. supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("Dockerfile.mustache", "", "Dockerfile")); 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 a7d445eb3c8..b2cf3774b87 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 @@ -42,6 +42,7 @@ import java.net.URL; import java.util.*; import java.util.regex.Matcher; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class KotlinSpringServerCodegen extends AbstractKotlinCodegen @@ -75,7 +76,6 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen private String invokerPackage; private String serverPort = "8080"; private String title = "OpenAPI Kotlin Spring"; - private String resourceFolder = "src/main/resources"; private boolean useBeanValidation = true; private boolean exceptionHandler = true; private boolean gradleBuildFile = true; @@ -234,14 +234,6 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen getDocumentationProvider().equals(DocumentationProvider.SOURCE); } - public String getResourceFolder() { - return this.resourceFolder; - } - - public void setResourceFolder(String resourceFolder) { - this.resourceFolder = resourceFolder; - } - public String getBasePackage() { return this.basePackage; } @@ -336,10 +328,6 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen this.reactive = reactive; } - public boolean isBeanQualifiers() { - return beanQualifiers; - } - public void setBeanQualifiers(boolean beanQualifiers) { this.beanQualifiers = beanQualifiers; } @@ -569,16 +557,16 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen (sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator), "HomeController.kt")); supportingFiles.add(new SupportingFile("openapi.mustache", - ("src/main/resources").replace("/", java.io.File.separator), "openapi.yaml")); + resourcesFolder.replace("/", java.io.File.separator), "openapi.yaml")); } - supportingFiles.add(new SupportingFile("application.mustache", resourceFolder, "application.yaml")); + supportingFiles.add(new SupportingFile("application.mustache", resourcesFolder, "application.yaml")); supportingFiles.add(new SupportingFile("springBootApplication.mustache", sanitizeDirectory(sourceFolder + File.separator + basePackage), "Application.kt")); if (useSwaggerUI && selectedDocumentationProviderRequiresSwaggerUiBootstrap()) { supportingFiles.add(new SupportingFile("swagger-ui.mustache", - "src/main/resources/static", "swagger-ui.html")); + resourcesFolder + "/static", "swagger-ui.html")); } } } @@ -656,7 +644,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen if (title.toUpperCase(Locale.ROOT).endsWith("API")) title = title.substring(0, title.length() - 3); - this.title = camelize(sanitizeName(title), true); + this.title = camelize(sanitizeName(title), LOWERCASE_FIRST_LETTER); } additionalProperties.put(TITLE, this.title); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java index c524436a051..af90ec386ad 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NimClientCodegen.java @@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class NimClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -253,10 +254,10 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig { String sanitizedOperationId = sanitizeName(operationId); if (isReservedWord(sanitizedOperationId)) { - sanitizedOperationId = "call" + StringUtils.camelize(sanitizedOperationId, false); + sanitizedOperationId = "call" + StringUtils.camelize(sanitizedOperationId); } - return StringUtils.camelize(sanitizedOperationId, true); + return StringUtils.camelize(sanitizedOperationId, LOWERCASE_FIRST_LETTER); } @Override @@ -320,7 +321,7 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig { // camelize (lower first character) the variable name // pet_id => petId - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved word or word starting with number, append _ if (isReservedWord(name)) { @@ -350,7 +351,7 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig { @Override public String toEnumName(CodegenProperty property) { - String name = StringUtils.camelize(property.name, false); + String name = StringUtils.camelize(property.name); if (name.matches("\\d.*")) { // starts with number return "`" + name + "`"; @@ -362,7 +363,7 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig { @Override public String toEnumVarName(String name, String datatype) { name = name.replace(" ", "_"); - name = StringUtils.camelize(name, false); + name = StringUtils.camelize(name); if (name.matches("\\d.*")) { // starts with number return "`" + name + "`"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java index 5a2a3822477..0b7f640cba5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java @@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -573,7 +574,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { // camelize (lower first character) the variable name // e.g. `pet_id` to `petId` - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved word or word starting with number, prepend `_` if (isReservedWord(name) || name.matches("^\\d.*")) { @@ -618,11 +619,12 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, camelize(sanitizeName("call_" + operationId), true)); - operationId = "call_" + operationId; + final String newName = "call_" + operationId; + LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newName); + operationId = newName; } - return camelize(sanitizeName(operationId), true); + return camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); } public void setClassPrefix(String classPrefix) { @@ -677,6 +679,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { /** * Return the default value of the schema + * * @param p OpenAPI schema object * @return string presentation of the default value of the schema */ @@ -795,5 +798,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { } @Override - public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.OBJECTIVE_C; } + public GeneratorLanguage generatorLanguage() { + return GeneratorLanguage.OBJECTIVE_C; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java index dadc17a6fff..16920f32fc9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java @@ -276,7 +276,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen { return "DefaultController"; } - return camelize(name, false) + "Controller"; + return camelize(name) + "Controller"; } protected String controllerFileFolder() { @@ -298,7 +298,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen { return "DefaultController"; } - return camelize(name, false) + "Controller"; + return camelize(name) + "Controller"; } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java index 373381eafed..a2388a6fc12 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSilexServerCodegen.java @@ -32,6 +32,7 @@ import org.openapitools.codegen.meta.Stability; import java.io.File; import java.util.*; +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; @@ -273,7 +274,7 @@ public class PhpSilexServerCodegen extends DefaultCodegen implements CodegenConf for (int i = 0; i < items.length; ++i) { if (items[i].matches("^\\{(.*)\\}$")) { // wrap in {} // camelize path variable - items[i] = "{" + camelize(items[i].substring(1, items[i].length() - 1), true) + "}"; + items[i] = "{" + camelize(items[i].substring(1, items[i].length() - 1), LOWERCASE_FIRST_LETTER) + "}"; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java index 4d1fb30fa29..85331d98613 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java @@ -613,14 +613,14 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg if (name.isEmpty()) { return "DefaultApiInterface"; } - return camelize(name, false) + "ApiInterface"; + return camelize(name) + "ApiInterface"; } protected String toControllerName(String name) { if (name.isEmpty()) { return "DefaultController"; } - return camelize(name, false) + "Controller"; + return camelize(name) + "Controller"; } protected String toSymfonyService(String name) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java index 1328efd8ec6..5401e682152 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java @@ -43,6 +43,7 @@ import java.io.Writer; import java.util.*; import java.util.regex.Pattern; +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; @@ -566,7 +567,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { if ("PascalCase".equals(operationIdNaming)) { return camelize(sanitizedOperationId); } else if ("camelCase".equals(operationIdNaming)) { - return camelize(sanitizedOperationId, true); + return camelize(sanitizedOperationId, LOWERCASE_FIRST_LETTER); } else if ("snake_case".equals(operationIdNaming)) { return underscore(sanitizedOperationId); } else { @@ -829,15 +830,19 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { public String toDefaultValue(Schema p) { if (ModelUtils.isBooleanSchema(p)) { if (p.getDefault() != null) { - if (Boolean.valueOf(p.getDefault().toString()) == false) + if (!Boolean.valueOf(p.getDefault().toString())) return "FALSE"; else return "TRUE"; } } else if (ModelUtils.isDateSchema(p)) { - // TODO + if (p.getDefault() != null) { + return "\"" + ((String.valueOf(p.getDefault()))).replaceAll("\"", "\\\"") + "\""; + } } else if (ModelUtils.isDateTimeSchema(p)) { - // TODO + if (p.getDefault() != null) { + return "\"" + ((String.valueOf(p.getDefault()))).replaceAll("\"", "\\\"") + "\""; + } } else if (ModelUtils.isNumberSchema(p)) { if (p.getDefault() != null) { return p.getDefault().toString(); @@ -922,9 +927,9 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { public String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps) { if (codegenParameter.isArray) { // array - return "list(" + constructExampleCode(codegenParameter.items, modelMaps, 0) + ")"; + return "c(" + constructExampleCode(codegenParameter.items, modelMaps, 0) + ")"; } else if (codegenParameter.isMap) { // map - return "list(key = " + constructExampleCode(codegenParameter.items, modelMaps, 0) + ")"; + return "c(key = " + constructExampleCode(codegenParameter.items, modelMaps, 0) + ")"; } else if (languageSpecificPrimitives.contains(codegenParameter.dataType)) { // primitive type return codegenParameter.example; } else { // model @@ -943,9 +948,9 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { depth++; if (codegenProperty.isArray) { // array - return "list(" + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")"; + return "c(" + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")"; } else if (codegenProperty.isMap) { // map - return "list(key = " + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")"; + return "c(key = " + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")"; } else if (languageSpecificPrimitives.contains(codegenProperty.dataType)) { // primitive type if ("character".equals(codegenProperty.dataType)) { if (StringUtils.isEmpty(codegenProperty.example)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 103114282ae..f4bbb55076c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -170,7 +170,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen { cliOptions.add(CliOption.newBoolean(USE_AUTOLOAD, "Use autoload instead of require to load modules."). defaultValue(Boolean.FALSE.toString())); - supportedLibraries.put(FARADAY, "Faraday (https://github.com/lostisland/faraday) (Beta support)"); + supportedLibraries.put(FARADAY, "Faraday >= 1.0.1 (https://github.com/lostisland/faraday)"); supportedLibraries.put(TYPHOEUS, "Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "HTTP library template (sub-template) to use"); 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 73559171943..bbfa8f6afbc 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 @@ -450,6 +450,7 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon String schemaType = super.getSchemaType(p); String type = typeMapping.getOrDefault(schemaType, schemaType); + // Implement integer type fitting (when property is enabled) if (Objects.equals(p.getType(), "integer")) { boolean bestFit = convertPropertyToBoolean(BEST_FIT_INT); boolean preferUnsigned = convertPropertyToBoolean(PREFER_UNSIGNED_INT); @@ -483,6 +484,18 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon return type; } + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + super.postProcessModelProperty(model, property); + + // If a property is both nullable and non-required then we represent this using a double Option + // which requires the `serde_with` extension crate for deserialization. + // See: https://docs.rs/serde_with/latest/serde_with/rust/double_option/index.html + if (property.isNullable && !property.required) { + additionalProperties.put("serdeWith", true); + } + } + @Override public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { OperationMap objectMap = objs.getOperations(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index 5d8d88d943e..60e977633c8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -1275,7 +1275,7 @@ public class RustServerCodegen extends AbstractRustCodegen implements CodegenCon int position = property.dataType.lastIndexOf(":"); property.dataType = property.dataType.substring(0, position) + camelize(property.dataType.substring(position)); } else { - property.dataType = camelize(property.dataType, false); + property.dataType = camelize(property.dataType); } property.isPrimitiveType = property.isContainer && languageSpecificPrimitives.contains(typeMapping.get(property.complexType)); } else { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java index a74eabfcfe8..9cb73a97b6e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java @@ -302,16 +302,6 @@ public class ScalaAkkaClientCodegen extends AbstractScalaCodegen implements Code } } - private static abstract class CustomLambda implements Mustache.Lambda { - @Override - public void execute(Template.Fragment frag, Writer out) throws IOException { - final StringWriter tempWriter = new StringWriter(); - frag.execute(tempWriter); - out.write(formatFragment(tempWriter.toString())); - } - - public abstract String formatFragment(String fragment); - } private static class JavadocLambda extends CustomLambda { @Override @@ -334,19 +324,6 @@ public class ScalaAkkaClientCodegen extends AbstractScalaCodegen implements Code } } - private static class CamelizeLambda extends CustomLambda { - private final boolean capitalizeFirst; - - public CamelizeLambda(boolean capitalizeFirst) { - this.capitalizeFirst = capitalizeFirst; - } - - @Override - public String formatFragment(String fragment) { - return camelize(fragment, !capitalizeFirst); - } - } - private class EnumEntryLambda extends CustomLambda { @Override public String formatFragment(String fragment) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java index de887007308..f8bf338f652 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java @@ -30,6 +30,7 @@ import java.util.Arrays; import java.util.EnumSet; import java.util.HashMap; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; /* @@ -200,7 +201,7 @@ public class ScalaHttpClientCodegen extends AbstractScalaCodegen implements Code throw new RuntimeException(operationId + " (reserved word) cannot be used as method name"); } - return camelize(operationId, true); + return camelize(operationId, LOWERCASE_FIRST_LETTER); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java index c4d38de101c..fedb4d8a1a7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaLagomServerCodegen.java @@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements CodegenConfig { @@ -163,7 +164,7 @@ public class ScalaLagomServerCodegen extends AbstractScalaCodegen implements Cod throw new RuntimeException(operationId + " (reserved word) cannot be used as method name"); } - return camelize(operationId, true); + return camelize(operationId, LOWERCASE_FIRST_LETTER); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java index eaa7dcf08a3..fe503eb1ed0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java @@ -41,6 +41,7 @@ import java.util.stream.Collectors; import static org.apache.commons.lang3.StringUtils.rightPad; import static org.openapitools.codegen.languages.AbstractJavaCodegen.DATE_LIBRARY; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implements CodegenConfig { @@ -243,7 +244,7 @@ public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implem Matcher match = pathVariableMatcher.matcher(operation.path); while (match.find()) { String completeMatch = match.group(); - String replacement = ":" + camelize(match.group(1), true); + String replacement = ":" + camelize(match.group(1), LOWERCASE_FIRST_LETTER); operation.path = operation.path.replace(completeMatch, replacement); } @@ -265,7 +266,7 @@ public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implem for (ModelMap mo : outer.getModels()) { CodegenModel cm = mo.getModel(); postProcessModelsEnum(outer); - cm.classVarName = camelize(cm.classVarName, true); + cm.classVarName = camelize(cm.classVarName, LOWERCASE_FIRST_LETTER); modelsByClassName.put(cm.classname, cm); boolean hasFiles = cm.vars.stream().anyMatch(var -> var.isFile); cm.vendorExtensions.put("x-has-files", hasFiles); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java index a5ef96adc72..dc7aaf221f4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaSttpClientCodegen.java @@ -32,6 +32,7 @@ import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.model.OperationMap; import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.utils.CamelizeOption; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,6 +45,8 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static org.openapitools.codegen.utils.CamelizeOption.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class ScalaSttpClientCodegen extends AbstractScalaCodegen implements CodegenConfig { @@ -560,17 +563,6 @@ public class ScalaSttpClientCodegen extends AbstractScalaCodegen implements Code } } - private static abstract class CustomLambda implements Mustache.Lambda { - @Override - public void execute(Template.Fragment frag, Writer out) throws IOException { - final StringWriter tempWriter = new StringWriter(); - frag.execute(tempWriter); - out.write(formatFragment(tempWriter.toString())); - } - - public abstract String formatFragment(String fragment); - } - private static class JavadocLambda extends CustomLambda { @Override public String formatFragment(String fragment) { @@ -592,19 +584,6 @@ public class ScalaSttpClientCodegen extends AbstractScalaCodegen implements Code } } - private static class CamelizeLambda extends CustomLambda { - private final boolean capitalizeFirst; - - public CamelizeLambda(boolean capitalizeFirst) { - this.capitalizeFirst = capitalizeFirst; - } - - @Override - public String formatFragment(String fragment) { - return camelize(fragment, !capitalizeFirst); - } - } - private class EnumEntryLambda extends CustomLambda { @Override public String formatFragment(String fragment) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java index 8f3971bd739..fe714b2ee87 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalazClientCodegen.java @@ -36,6 +36,7 @@ import java.util.Arrays; import java.util.EnumSet; import java.util.HashMap; +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; @@ -152,7 +153,7 @@ public class ScalazClientCodegen extends AbstractScalaCodegen implements Codegen case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: @@ -228,7 +229,7 @@ public class ScalazClientCodegen extends AbstractScalaCodegen implements Codegen throw new RuntimeException(operationId + " (reserved word) cannot be used as method name"); } - return camelize(operationId, true); + return camelize(operationId, LOWERCASE_FIRST_LETTER); } private static abstract class CustomLambda implements Mustache.Lambda { 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 7820efb9426..b43a9aa1c78 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 @@ -18,14 +18,17 @@ package org.openapitools.codegen.languages; import static org.apache.commons.lang3.StringUtils.isNotEmpty; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; import com.samskivert.mustache.Mustache; +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.media.Schema; import io.swagger.v3.oas.models.servers.Server; + import java.io.File; import java.net.URL; import java.util.ArrayList; @@ -40,6 +43,7 @@ import java.util.Objects; import java.util.Set; import java.util.regex.Matcher; import java.util.stream.Collectors; + import org.apache.commons.lang3.tuple.Pair; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; @@ -102,6 +106,25 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String UNHANDLED_EXCEPTION_HANDLING = "unhandledException"; public static final String USE_SPRING_BOOT3 = "useSpringBoot3"; public static final String USE_JAKARTA_EE = "useJakartaEe"; + public static final String REQUEST_MAPPING_OPTION = "requestMappingMode"; + public static final String USE_REQUEST_MAPPING_ON_CONTROLLER = "useRequestMappingOnController"; + public static final String USE_REQUEST_MAPPING_ON_INTERFACE = "useRequestMappingOnInterface"; + + public enum RequestMappingMode { + api_interface("Generate the @RequestMapping annotation on the generated Api Interface."), + controller("Generate the @RequestMapping annotation on the generated Api Controller Implementation."), + none("Do not add a class level @RequestMapping annotation."); + + public String getDescription() { + return description; + } + + private String description; + + RequestMappingMode(String description) { + this.description = description; + } + } public static final String OPEN_BRACE = "{"; public static final String CLOSE_BRACE = "}"; @@ -111,7 +134,6 @@ public class SpringCodegen extends AbstractJavaCodegen protected String basePackage = "org.openapitools"; protected boolean interfaceOnly = false; protected boolean useFeignClientUrl = true; - protected boolean useFeignClient = false; protected boolean delegatePattern = false; protected boolean delegateMethod = false; protected boolean singleContentTypes = false; @@ -131,6 +153,7 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean useSpringController = false; protected boolean useSwaggerUI = true; protected boolean useSpringBoot3 = false; + protected RequestMappingMode requestMappingMode = RequestMappingMode.controller; public SpringCodegen() { super(); @@ -203,6 +226,15 @@ public class SpringCodegen extends AbstractJavaCodegen cliOptions .add(CliOption.newBoolean(RETURN_SUCCESS_CODE, "Generated server returns 2xx code", returnSuccessCode)); cliOptions.add(CliOption.newBoolean(SPRING_CONTROLLER, "Annotate the generated API as a Spring Controller", useSpringController)); + + CliOption requestMappingOpt = new CliOption(REQUEST_MAPPING_OPTION, + "Where to generate the class level @RequestMapping annotation.") + .defaultValue(requestMappingMode.name()); + for (RequestMappingMode mode: RequestMappingMode.values()) { + requestMappingOpt.addEnum(mode.name(), mode.getDescription()); + } + cliOptions.add(requestMappingOpt); + cliOptions.add(CliOption.newBoolean(UNHANDLED_EXCEPTION_HANDLING, "Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).", unhandledException)); @@ -299,6 +331,13 @@ public class SpringCodegen extends AbstractJavaCodegen LOGGER.info("Set base package to invoker package ({})", basePackage); } + if (additionalProperties.containsKey(REQUEST_MAPPING_OPTION)) { + RequestMappingMode optValue = RequestMappingMode.valueOf( + String.valueOf(additionalProperties.get(REQUEST_MAPPING_OPTION))); + setRequestMappingMode(optValue); + additionalProperties.remove(REQUEST_MAPPING_OPTION); + } + useOneOfInterfaces = true; legacyDiscriminatorBehavior = false; @@ -493,10 +532,15 @@ public class SpringCodegen extends AbstractJavaCodegen additionalProperties.put(SINGLE_CONTENT_TYPES, "true"); this.setSingleContentTypes(true); } + // @RequestMapping not supported with spring cloud openfeign. + setRequestMappingMode(RequestMappingMode.none); additionalProperties.put(USE_FEIGN_CLIENT, "true"); - this.setUseFeignClient(true); } else { apiTemplateFiles.put("apiController.mustache", "Controller.java"); + if (containsEnums()) { + supportingFiles.add(new SupportingFile("converter.mustache", + (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), "EnumConverterConfiguration.java")); + } supportingFiles.add(new SupportingFile("application.mustache", ("src.main.resources").replace(".", java.io.File.separator), "application.properties")); supportingFiles.add(new SupportingFile("homeController.mustache", @@ -573,6 +617,19 @@ public class SpringCodegen extends AbstractJavaCodegen } } + switch (getRequestMappingMode()) { + case api_interface: + additionalProperties.put(USE_REQUEST_MAPPING_ON_INTERFACE, true); + break; + case controller: + additionalProperties.put(USE_REQUEST_MAPPING_ON_CONTROLLER, true); + break; + case none: + additionalProperties.put(USE_REQUEST_MAPPING_ON_INTERFACE, false); + additionalProperties.put(USE_REQUEST_MAPPING_ON_CONTROLLER, false); + break; + } + // add lambda for mustache templates additionalProperties.put("lambdaRemoveDoubleQuote", (Mustache.Lambda) (fragment, writer) -> writer .write(fragment.execute().replaceAll("\"", Matcher.quoteReplacement("")))); @@ -594,6 +651,20 @@ public class SpringCodegen extends AbstractJavaCodegen } } + private boolean containsEnums() { + if (openAPI == null) { + return false; + } + + Components components = this.openAPI.getComponents(); + if (components == null || components.getSchemas() == null) { + return false; + } + + return components.getSchemas().values().stream() + .anyMatch(it -> it.getEnum() != null && !it.getEnum().isEmpty()); + } + @Override public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { @@ -639,7 +710,7 @@ public class SpringCodegen extends AbstractJavaCodegen title = title.substring(0, title.length() - 3); } - this.title = camelize(sanitizeName(title), true); + this.title = camelize(sanitizeName(title), LOWERCASE_FIRST_LETTER); } additionalProperties.put(TITLE, this.title); } @@ -767,7 +838,7 @@ public class SpringCodegen extends AbstractJavaCodegen final List authMethods = (List) objs.get("authMethods"); if (authMethods != null) { for (final CodegenSecurity authMethod : authMethods) { - authMethod.name = camelize(sanitizeName(authMethod.name), true); + authMethod.name = camelize(sanitizeName(authMethod.name), LOWERCASE_FIRST_LETTER); } } } @@ -850,10 +921,6 @@ public class SpringCodegen extends AbstractJavaCodegen this.singleContentTypes = singleContentTypes; } - public void setUseFeignClient( boolean useFeignClient ) { - this.useFeignClient = useFeignClient; - } - public void setSkipDefaultInterface(boolean skipDefaultInterface) { this.skipDefaultInterface = skipDefaultInterface; } @@ -1098,4 +1165,12 @@ public class SpringCodegen extends AbstractJavaCodegen public void setUseSpringBoot3(boolean useSpringBoot3) { this.useSpringBoot3 = useSpringBoot3; } + + public RequestMappingMode getRequestMappingMode() { + return requestMappingMode; + } + + public void setRequestMappingMode(RequestMappingMode requestMappingMode) { + this.requestMappingMode = requestMappingMode; + } } 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 4d430ac4ee5..a1d0dab0517 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 @@ -42,6 +42,7 @@ import java.time.Instant; import java.time.temporal.ChronoField; import java.util.concurrent.TimeUnit; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -827,7 +828,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig @Override public String toOperationId(String operationId) { - operationId = camelize(sanitizeName(operationId), true); + operationId = camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); // Throw exception if method name is empty. // This should not happen but keep the check just in case @@ -837,15 +838,15 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig // method name cannot use reserved keyword, e.g. return if (isReservedWord(operationId)) { - String newOperationId = camelize(("call_" + operationId), true); + String newOperationId = camelize(("call_" + operationId), LOWERCASE_FIRST_LETTER); LOGGER.warn("{} (reserved word) cannot be used as method name. Renamed to {}", operationId, newOperationId); return newOperationId; } // operationId starts with a number if (operationId.matches("^\\d.*")) { - LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, camelize(sanitizeName("call_" + operationId), true)); - operationId = camelize(sanitizeName("call_" + operationId), true); + LOGGER.warn("{} (starting with a number) cannot be used as method name. Renamed to {}", operationId, camelize(sanitizeName("call_" + operationId), LOWERCASE_FIRST_LETTER)); + operationId = camelize(sanitizeName("call_" + operationId), LOWERCASE_FIRST_LETTER); } @@ -864,7 +865,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig // camelize the variable name // pet_id => petId - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved words surround with `` or append _ if (isReservedWord(name)) { @@ -894,7 +895,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig // camelize(lower) the variable name // pet_id => petId - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); // for reserved words surround with `` if (isReservedWord(name)) { @@ -1019,7 +1020,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig if (enumUnknownDefaultCase) { if (name.equals(enumUnknownDefaultCaseName)) { - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); } } @@ -1031,18 +1032,18 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig // Prefix with underscore if name starts with number if (name.matches("\\d.*")) { - return "_" + replaceSpecialCharacters(camelize(name, true)); + return "_" + replaceSpecialCharacters(camelize(name, LOWERCASE_FIRST_LETTER)); } // for symbol, e.g. $, # if (getSymbolName(name) != null) { - return camelize(WordUtils.capitalizeFully(getSymbolName(name).toUpperCase(Locale.ROOT)), true); + return camelize(WordUtils.capitalizeFully(getSymbolName(name).toUpperCase(Locale.ROOT)), LOWERCASE_FIRST_LETTER); } // Camelize only when we have a structure defined below - Boolean camelized = false; + boolean camelized = false; if (name.matches("[A-Z][a-z0-9]+[a-zA-Z0-9]*")) { - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); camelized = true; } @@ -1062,7 +1063,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig char[] separators = {'-', '_', ' ', ':', '(', ')'}; return camelize(replaceSpecialCharacters(WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators) .replaceAll("[-_ :\\(\\)]", "")), - true); + LOWERCASE_FIRST_LETTER); } private String replaceSpecialCharacters(String name) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 3457324b538..612b9502ad1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -36,6 +36,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import static org.apache.commons.lang3.StringUtils.capitalize; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.*; public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCodegen { @@ -731,7 +732,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode if ("kebab-case".equals(fileNaming)) { name = dashize(underscore(name)); } else { - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); } return name; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java index 73448a4cbef..2b815369955 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java @@ -17,6 +17,7 @@ package org.openapitools.codegen.languages; +import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.apache.commons.lang3.StringUtils; @@ -287,4 +288,10 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege updatePropertyForMap(property, p); } } + + @Override + protected void addImport(ComposedSchema composed, Schema childSchema, CodegenModel model, String modelName) { + // import everything (including child schema of a composed schema) + addImport(model, modelName); + } } 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 934fef92462..93ef3994ec4 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 @@ -54,6 +54,7 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; +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; @@ -125,7 +126,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred", "requestOptions", "from", // Typescript reserved words - "abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "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")); + "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")); languageSpecificPrimitives = new HashSet<>(Arrays.asList( "string", @@ -588,10 +589,10 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo // method name cannot use reserved keyword, e.g. return // append _ at the beginning, e.g. _return if (isReservedWord(operationId)) { - return escapeReservedWord(camelize(sanitizeName(operationId), true)); + return escapeReservedWord(camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER)); } - return camelize(sanitizeName(operationId), true); + return camelize(sanitizeName(operationId), LOWERCASE_FIRST_LETTER); } public void setModelPropertyNaming(String naming) { @@ -614,7 +615,7 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo case original: return name; case camelCase: - return camelize(name, true); + return camelize(name, LOWERCASE_FIRST_LETTER); case PascalCase: return camelize(name); case snake_case: diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java index 6fdb5f0d169..fb4c041cf93 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java @@ -31,6 +31,7 @@ import org.openapitools.codegen.model.OperationsMap; import java.io.File; import java.util.*; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class TypeScriptInversifyClientCodegen extends AbstractTypeScriptClientCodegen { @@ -315,7 +316,7 @@ public class TypeScriptInversifyClientCodegen extends AbstractTypeScriptClientCo if (name.length() == 0) { return "default.service"; } - return camelize(name, true) + ".service"; + return camelize(name, LOWERCASE_FIRST_LETTER) + ".service"; } @Override @@ -325,7 +326,7 @@ public class TypeScriptInversifyClientCodegen extends AbstractTypeScriptClientCo @Override public String toModelFilename(String name) { - return camelize(toModelName(name), true); + return camelize(toModelName(name), LOWERCASE_FIRST_LETTER); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java index 19b9369bd80..bc74742e283 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java @@ -33,6 +33,7 @@ import java.io.File; import java.util.*; import static org.apache.commons.lang3.StringUtils.capitalize; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.*; public class TypeScriptNestjsClientCodegen extends AbstractTypeScriptClientCodegen { @@ -543,7 +544,7 @@ public class TypeScriptNestjsClientCodegen extends AbstractTypeScriptClientCodeg if ("kebab-case".equals(fileNaming)) { name = dashize(underscore(name)); } else { - name = camelize(name, true); + name = camelize(name, LOWERCASE_FIRST_LETTER); } return name; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java index cd5cde237a2..953465863c3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java @@ -35,6 +35,7 @@ import java.io.File; import java.util.*; import static org.apache.commons.lang3.StringUtils.capitalize; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.camelize; public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen { @@ -141,7 +142,7 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen if (importMapping.containsKey(name)) { return importMapping.get(name); } - return camelize(name, true) + apiSuffix; + return camelize(name, LOWERCASE_FIRST_LETTER) + apiSuffix; } @Override @@ -159,7 +160,7 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen return importMapping.get(name); } - return DEFAULT_MODEL_FILENAME_DIRECTORY_PREFIX + camelize(toModelName(name), true); + return DEFAULT_MODEL_FILENAME_DIRECTORY_PREFIX + camelize(toModelName(name), LOWERCASE_FIRST_LETTER); } @Override @@ -168,7 +169,7 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen return importMapping.get(name); } - return DEFAULT_MODEL_IMPORT_DIRECTORY_PREFIX + modelPackage() + "/" + camelize(toModelName(name), true); + return DEFAULT_MODEL_IMPORT_DIRECTORY_PREFIX + modelPackage() + "/" + camelize(toModelName(name), LOWERCASE_FIRST_LETTER); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java index e9091517b3b..aeaca5caf3c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java @@ -18,6 +18,7 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; @@ -420,4 +421,10 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen this.hasOptionalQueryParams = false; // will be updated within addConditionalImportInformation } } + + @Override + protected void addImport(ComposedSchema composed, Schema childSchema, CodegenModel model, String modelName) { + // import everything (including child schema of a composed schema) + addImport(model, modelName); + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/CamelCaseLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/CamelCaseLambda.java index 034d0cee76d..d7b14546f19 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/CamelCaseLambda.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/CamelCaseLambda.java @@ -20,10 +20,13 @@ package org.openapitools.codegen.templating.mustache; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.utils.CamelizeOption; import java.io.IOException; import java.io.Writer; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; +import static org.openapitools.codegen.utils.CamelizeOption.UPPERCASE_FIRST_CHAR; import static org.openapitools.codegen.utils.StringUtils.camelize; /** @@ -42,10 +45,14 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; public class CamelCaseLambda implements Mustache.Lambda { private CodegenConfig generator = null; private Boolean escapeParam = false; - private Boolean lowercaseFirstLetter = true; + private CamelizeOption option = LOWERCASE_FIRST_LETTER; public CamelCaseLambda(boolean lowercaseFirstLetter) { - this.lowercaseFirstLetter = lowercaseFirstLetter; + if (lowercaseFirstLetter) { + option = LOWERCASE_FIRST_LETTER; + } else { + option = UPPERCASE_FIRST_CHAR; + } } public CamelCaseLambda() {} @@ -62,7 +69,7 @@ public class CamelCaseLambda implements Mustache.Lambda { @Override public void execute(Template.Fragment fragment, Writer writer) throws IOException { - String text = camelize(fragment.execute().replace(" ", "_"), lowercaseFirstLetter); + String text = camelize(fragment.execute().replace(" ", "_"), option); if (generator != null) { text = generator.sanitizeName(text); if (generator.reservedWords().contains(text)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/TitlecaseLambda.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/TitlecaseLambda.java index 2d94a5ad7b8..913578f8c99 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/TitlecaseLambda.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/mustache/TitlecaseLambda.java @@ -61,7 +61,15 @@ public class TitlecaseLambda implements Mustache.Lambda { } private String titleCase(final String input) { - return input.substring(0, 1).toUpperCase(Locale.ROOT) + input.substring(1); + if(input == null || "".equals(input)){ + return ""; + } + + String firstLetter = input.substring(0, 1).toUpperCase(Locale.ROOT); + if (input.length() == 1) { + return firstLetter; + } + return firstLetter + input.substring(1); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/CamelizeOption.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/CamelizeOption.java new file mode 100644 index 00000000000..838b56b1f2f --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/CamelizeOption.java @@ -0,0 +1,7 @@ +package org.openapitools.codegen.utils; + +public enum CamelizeOption { + UPPERCASE_FIRST_CHAR, + LOWERCASE_FIRST_LETTER, + LOWERCASE_FIRST_CHAR +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java index afd23f24cd7..6f81ef9a327 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java @@ -17,6 +17,8 @@ import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static org.openapitools.codegen.utils.CamelizeOption.UPPERCASE_FIRST_CHAR; + public class StringUtils { /** @@ -30,7 +32,7 @@ public class StringUtils { // A cache of camelized words. The camelize() method is invoked many times with the same // arguments, this cache is used to optimized performance. - private static Cache, String> camelizedWordsCache; + private static Cache, String> camelizedWordsCache; // A cache of underscored words, used to optimize the performance of the underscore() method. private static Cache underscoreWordsCache; @@ -111,7 +113,7 @@ public class StringUtils { * @return camelized string */ public static String camelize(String word) { - return camelize(word, false); + return camelize(word, UPPERCASE_FIRST_CHAR); } private static Pattern camelizeSlashPattern = Pattern.compile("\\/(.?)"); @@ -124,16 +126,16 @@ public class StringUtils { /** * Camelize name (parameter, property, method, etc) * - * @param inputWord string to be camelize - * @param lowercaseFirstLetter lower case for first letter if set to true + * @param inputWord string to be camelize + * @param camelizeOption option for the camelize result * @return camelized string */ - public static String camelize(final String inputWord, boolean lowercaseFirstLetter) { - Pair key = new ImmutablePair<>(inputWord, lowercaseFirstLetter); + public static String camelize(final String inputWord, CamelizeOption camelizeOption) { + Pair key = new ImmutablePair<>(inputWord, camelizeOption); return camelizedWordsCache.get(key, pair -> { String word = pair.getKey(); - Boolean lowerFirstLetter = pair.getValue(); + CamelizeOption option = pair.getValue(); // Replace all slashes with dots (package separator) Matcher m = camelizeSlashPattern.matcher(word); while (m.find()) { @@ -185,15 +187,13 @@ public class StringUtils { m = camelizeHyphenPattern.matcher(word); } - if (lowerFirstLetter && word.length() > 0) { - int i = 0; - char charAt = word.charAt(i); - while (i + 1 < word.length() && !((charAt >= 'a' && charAt <= 'z') || (charAt >= 'A' && charAt <= 'Z'))) { - i = i + 1; - charAt = word.charAt(i); - } - i = i + 1; - word = word.substring(0, i).toLowerCase(Locale.ROOT) + word.substring(i); + switch (option) { + case LOWERCASE_FIRST_LETTER: + word = lowercaseFirstLetter(word); + break; + case LOWERCASE_FIRST_CHAR: + word = word.substring(0, 1).toLowerCase(Locale.ROOT) + word.substring(1); + break; } // remove all underscore @@ -202,6 +202,20 @@ public class StringUtils { }); } + private static String lowercaseFirstLetter(String word) { + if (word.length() > 0) { + int i = 0; + char charAt = word.charAt(i); + while (i + 1 < word.length() && !((charAt >= 'a' && charAt <= 'z') || (charAt >= 'A' && charAt <= 'Z'))) { + i = i + 1; + charAt = word.charAt(i); + } + i = i + 1; + word = word.substring(0, i).toLowerCase(Locale.ROOT) + word.substring(i); + } + return word; + } + private static class EscapedNameOptions { public EscapedNameOptions(String name, Set specialChars, List charactersToAllow, String appendToReplacement) { this.name = name; diff --git a/modules/openapi-generator/src/main/resources/Java/ServerConfiguration.mustache b/modules/openapi-generator/src/main/resources/Java/ServerConfiguration.mustache index 7f640ba7475..8b4cf59ff0a 100644 --- a/modules/openapi-generator/src/main/resources/Java/ServerConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/Java/ServerConfiguration.mustache @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index d3760936834..39ef41c0339 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -117,7 +117,7 @@ ext { jackson_version = "2.12.6" jackson_databind_version = "2.12.6.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" jersey_version = "1.19.4" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache index 84589d91afd..911979d76a4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache @@ -114,10 +114,10 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.12.6" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" httpclient_version = "4.5.13" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache index e7fef245346..638d2142af1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/pom.mustache @@ -327,8 +327,8 @@ UTF-8 1.5.21 4.5.13 - 2.12.6 - 2.12.6.1 + 2.13.4 + 2.13.4.2 1.3.5 {{#useBeanValidation}} 2.0.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index 6d320edcc9a..bb35f8689f7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -102,10 +102,10 @@ test { ext { swagger_annotations_version = "1.5.24" - jackson_version = "2.12.6.1" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" feign_version = "10.11" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache index 065280d08d8..da07dcf61ae 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -16,9 +16,9 @@ lazy val root = (project in file(".")). "io.github.openfeign" % "feign-slf4j" % "10.11" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", "io.github.openfeign" % "feign-okhttp" % "10.11" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.6.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.12.6.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 2e9e1be46a3..fb8a34aa42f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -354,11 +354,11 @@ 1.5.24 10.11 3.8.0 - 2.12.5 + 2.13.4 {{#openApiNullable}} - 0.2.3 + 0.2.4 {{/openApiNullable}} - 2.12.6.1 + 2.13.4.2 1.3.5 5.7.0 1.0.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index 629facf2582..c14b05a571c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -98,10 +98,10 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.12.5" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" google_api_client_version = "1.32.2" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache index c08c686ca6b..78da21f2e81 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache @@ -12,9 +12,9 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.22", "com.google.api-client" % "google-api-client" % "1.23.0", "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", {{#withXml}} "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.9.10" % "compile", {{/withXml}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache index e1d06d235e7..44cc6295a6e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache @@ -297,10 +297,10 @@ 1.5.22 1.32.2 2.25.1 - 2.12.5 - 2.12.6.1 + 2.13.4 + 2.13.4.2 {{#openApiNullable}} - 0.2.3 + 0.2.4 {{/openApiNullable}} {{#joda}} 2.9.9 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 bf9545f34f4..2a027220da7 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 @@ -524,6 +524,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link org.openapitools.client.ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + /** * Helper method to set the password flow for the first OAuth2 authentication. * diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/OAuth.mustache index b7e28e55bfc..8908aa543dd 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/OAuth.mustache @@ -158,6 +158,19 @@ public class OAuth implements Authentication { return this; } + public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe().debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe() + .build(authApi); + } + return this; + } + public OAuth usePasswordFlow(String username, String password) { this.flow = OAuthFlow.PASSWORD; this.username = username; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index e12528af751..b11d0add3ca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -99,10 +99,10 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.2" - jackson_databind_version = "2.13.2.2" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index 5ff4b1b0285..dc65e1b496b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -18,13 +18,13 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.2" % "compile", {{/joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4" % "compile", {{/openApiNullable}} {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index dc5a3f4a71a..aceaa42112f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -382,9 +382,9 @@ UTF-8 1.6.5 2.35 - 2.13.2 - 2.13.2.2 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 {{#useBeanValidation}} 2.0.2 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 baaa6037fab..a89642a2758 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 @@ -524,6 +524,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link org.openapitools.client.ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + /** * Helper method to set the password flow for the first OAuth2 authentication. * diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/OAuth.mustache index 993bfdcd394..67f56597696 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/OAuth.mustache @@ -158,6 +158,19 @@ public class OAuth implements Authentication { return this; } + public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe().debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe() + .build(authApi); + } + return this; + } + public OAuth usePasswordFlow(String username, String password) { this.flow = OAuthFlow.PASSWORD; this.username = username; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache index 8c555046415..55c2dfd81af 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache @@ -99,10 +99,10 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.2" - jackson_databind_version = "2.13.2.2" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "2.1.0" jersey_version = "3.0.4" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache index 1574b6e6df7..ee811eb8ce7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache @@ -16,15 +16,15 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.2" % "compile", {{/joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4" % "compile", {{/openApiNullable}} {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache index 9427390e9e2..e546d4a1f7e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache @@ -382,9 +382,9 @@ UTF-8 1.6.5 3.0.4 - 2.13.2 - 2.13.2.2 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 2.1.0 {{#useBeanValidation}} 2.0.2 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 3d15f663bf7..0255e20c1fc 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 @@ -336,7 +336,12 @@ public class {{classname}} { {{#isExplode}} {{#hasVars}} {{#vars}} + {{#isArray}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{^isArray}} localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} {{/vars}} {{/hasVars}} {{^hasVars}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache index af793714675..ef6404095a7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -222,7 +222,7 @@ 11 11 2.13.4 - 0.2.3 + 0.2.4 1.3.5 4.13.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 67dcd41e643..c81b9643a10 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -179,7 +179,6 @@ public class ApiClient { this.basePath = basePath; } -{{#hasOAuthMethods}} String tokenUrl = "{{{tokenUrl}}}"; if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { URI uri = URI.create(getBasePath()); @@ -196,7 +195,6 @@ public class ApiClient { retryingOAuth ); initHttpClient(Collections.singletonList(retryingOAuth)); -{{/hasOAuthMethods}} // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} @@ -387,7 +385,7 @@ public class ApiClient { * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); + JSON.setDateFormat(dateFormat); return this; } @@ -398,18 +396,18 @@ public class ApiClient { * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); + JSON.setSqlDateFormat(dateFormat); return this; } {{#joda}} public ApiClient setDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setDateTimeFormat(dateFormat); + JSON.setDateTimeFormat(dateFormat); return this; } public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -422,7 +420,7 @@ public class ApiClient { * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); + JSON.setOffsetDateTimeFormat(dateFormat); return this; } @@ -433,7 +431,7 @@ public class ApiClient { * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -445,7 +443,7 @@ public class ApiClient { * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + JSON.setLenientOnJson(lenientOnJson); return this; } @@ -745,7 +743,7 @@ public class ApiClient { return ""; } else if (param instanceof Date {{#joda}}|| param instanceof DateTime || param instanceof LocalDate{{/joda}}{{#jsr310}}|| param instanceof OffsetDateTime || param instanceof LocalDate{{/jsr310}}) { //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -753,7 +751,7 @@ public class ApiClient { if (b.length() > 0) { b.append(","); } - b.append(String.valueOf(o)); + b.append(o); } return b.toString(); } else { @@ -1045,7 +1043,7 @@ public class ApiClient { contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; @@ -1079,13 +1077,13 @@ public class ApiClient { } else if (isJsonMime(contentType)) { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } @@ -1583,7 +1581,7 @@ public class ApiClient { } else { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } @@ -1661,7 +1659,7 @@ public class ApiClient { KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); + String certificateAlias = "ca" + (index++); caKeyStore.setCertificateEntry(certificateAlias, certificate); } trustManagerFactory.init(caKeyStore); @@ -1736,7 +1734,7 @@ public class ApiClient { if (entry.getKey().equals(param.getName())) { switch (param.getIn()) { case "path": - path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString())); + path = path.replace("{" + param.getName() + "}", escapeString(value.toString())); break; case "query": if (value instanceof Collection) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/additional_properties.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/additional_properties.mustache index 96c779fd24a..bca54f84d57 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/additional_properties.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/additional_properties.mustache @@ -9,6 +9,10 @@ /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the {{classname}} instance itself */ public {{classname}} putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -20,6 +24,8 @@ /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -27,6 +33,9 @@ /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index 52002f8c507..d39478decb6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -137,7 +137,7 @@ public class {{classname}} { // create path and map variables {{^dynamicOperations}} String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; + .replace("{" + "{{baseName}}" + "}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; {{/dynamicOperations}} {{#dynamicOperations}} ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}"); @@ -193,7 +193,9 @@ public class {{classname}} { {{/dynamicOperations}} final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -201,7 +203,9 @@ public class {{classname}} { } final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -218,15 +222,16 @@ public class {{classname}} { @SuppressWarnings("rawtypes") private okhttp3.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { {{^performBeanValidation}} - {{#allParams}}{{#required}} + {{#allParams}} + {{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)"); } - {{/required}}{{/allParams}} - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; + {{/required}} + {{/allParams}} + return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); {{/performBeanValidation}} {{#performBeanValidation}} @@ -240,9 +245,7 @@ public class {{classname}} { parameterValues); if (violations.size() == 0) { - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - + return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); } else { throw new BeanValidationException((Set) violations); } @@ -253,7 +256,6 @@ public class {{classname}} { e.printStackTrace(); throw new ApiException(e.getMessage()); } - {{/performBeanValidation}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache index cb0e8250550..f11b22c629d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache @@ -56,6 +56,7 @@ public class OAuthOkHttpClient implements HttpClient { response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache index 53f1de15fee..8fea0d29264 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/auth/RetryingOAuth.mustache @@ -66,8 +66,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { .setClientSecret(clientSecret)); setFlow(flow); if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); } } } @@ -130,8 +130,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { } Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); } requestBuilder.url(oAuthRequest.getLocationUri()); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index 17258d13e7a..2183fa8d790 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -15,7 +15,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -69,7 +69,7 @@ if(hasProperty('target') && target == 'android') { task.from variant.javaCompile.destinationDir task.destinationDir = project.file("${project.buildDir}/outputs/jar") task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + artifacts.add('archives', task) } } @@ -110,19 +110,19 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.6.5' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.3' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3' - implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.8.5' implementation 'javax.ws.rs:jsr311-api:1.1.1' implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' {{#openApiNullable}} - implementation 'org.openapitools:jackson-databind-nullable:0.2.3' + implementation 'org.openapitools:jackson-databind-nullable:0.2.4' {{/openApiNullable}} {{#hasOAuthMethods}} - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' {{/hasOAuthMethods}} implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' {{#joda}} @@ -132,9 +132,9 @@ dependencies { implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30' {{/dynamicOperations}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' } javadoc { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index e3612cb5d9f..77d6183a97a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache @@ -10,17 +10,17 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.6.5", - "com.squareup.okhttp3" % "okhttp" % "4.9.3", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.3", - "com.google.code.gson" % "gson" % "2.9.0", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", "org.apache.commons" % "commons-lang3" % "3.12.0", "javax.ws.rs" % "jsr311-api" % "1.1.1", "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.3", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", {{/openApiNullable}} {{#hasOAuthMethods}} - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", {{/hasOAuthMethods}} {{#joda}} "joda-time" % "joda-time" % "2.9.9" % "compile", @@ -32,7 +32,8 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" ) ) 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 b2d6a194208..ff011f9a016 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 @@ -12,6 +12,7 @@ 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; @@ -497,10 +498,20 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/required}} {{/items.isModel}} {{^items.isModel}} - // ensure the json data is an array - if ({{#required}}(jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) && {{/required}}!jsonObj.get("{{{baseName}}}").isJsonArray()) { + {{^required}} + // ensure the optional json data is an array if present + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); } + {{/required}} + {{#required}} + // ensure the required json array is present + if (jsonObj.get("{{{baseName}}}") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + {{/required}} {{/items.isModel}} {{/isArray}} {{^isContainer}} @@ -597,8 +608,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 992436ede09..d2a7e2cce97 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -57,7 +57,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.1.0 enforce-maven @@ -100,6 +100,7 @@ maven-dependency-plugin + 3.3.0 package @@ -116,7 +117,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -130,7 +131,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -161,7 +162,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.2 + 3.4.1 attach-javadocs @@ -184,7 +185,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.2.1 attach-sources @@ -299,7 +300,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.client - 1.0.1 + 1.0.2 {{/hasOAuthMethods}} @@ -401,14 +402,14 @@ ${java.version} 1.8.5 1.6.5 - 4.9.3 - 2.9.0 + 4.10.0 + 2.9.1 3.12.0 {{#openApiNullable}} - 0.2.3 + 0.2.4 {{/openApiNullable}} {{#joda}} - 2.10.13 + 2.12.0 {{/joda}} 1.3.5 {{#performBeanValidation}} @@ -417,12 +418,12 @@ {{#useBeanValidation}} 2.0.2 {{/useBeanValidation}} - 5.8.2 - 1.6.2 + 5.9.1 + 1.9.1 3.12.4 2.1.1 1.1.1 UTF-8 - 2.21.0 + 2.27.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index 4c9801cfdc4..67a9e7191a4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -101,10 +101,10 @@ ext { rest_assured_version = "4.5.1" junit_version = "4.13.2" {{#jackson}} - jackson_version = "2.12.5" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{/jackson}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache index 47acb40b9c5..820edf8d661 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache @@ -14,19 +14,19 @@ lazy val root = (project in file(".")). "io.rest-assured" % "scala-support" % "4.5.1", "com.google.code.findbugs" % "jsr305" % "3.0.2", {{#jackson}} - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.5", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.12.5", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.3", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", {{/openApiNullable}} {{#withXml}} - "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.12.6.1", + "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.13.4.1", {{/withXml}} {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.12.6.1", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.4.1", {{/joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.12.6.1", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.4.1", {{/jackson}} {{#gson}} "com.google.code.gson" % "gson" % "2.8.9", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache index b1d15a0dc80..21c5cf6d25d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache @@ -338,9 +338,9 @@ 2.10.5 {{/joda}} {{#jackson}} - 2.12.5 - 2.12.6.1 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 {{/jackson}} 1.3.5 {{#useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index 1ab85d70556..93a8b84ffc8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -98,10 +98,10 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.10.5" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache index 97d330b7da0..3e1de7399e1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "4.5.11.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "4.5.11.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache index 12f66fe0852..51ad71c3d76 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -279,10 +279,10 @@ UTF-8 1.6.3 4.7.6.Final - 2.10.5 - 2.12.6.1 + 2.13.4 + 2.13.4.2 {{#openApiNullable}} - 0.2.3 + 0.2.4 {{/openApiNullable}} 1.3.5 2.9.10 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 edf70a6237a..ba319ebc890 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 @@ -98,10 +98,10 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" spring_web_version = "5.3.18" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache index 223bc90517f..637ce128ca9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache @@ -308,7 +308,7 @@ 5.3.18 2.12.7 2.12.7 - 0.2.3 + 0.2.4 1.3.5 {{#joda}} 2.9.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index 7f2b0569ae8..5deba46d401 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -100,10 +100,10 @@ ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" {{#usePlayWS}} - jackson_version = "2.12.1" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} play_version = "2.6.7" {{/usePlayWS}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index f19624661e5..0bc66fde845 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -18,9 +18,9 @@ lazy val root = (project in file(".")). "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.12.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", {{/usePlayWS}} {{#useRxJava2}} "com.squareup.retrofit2" % "adapter-rxjava2" % "2.3.0" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index ce5a737fd40..5ec0dd02534 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -363,11 +363,11 @@ 1.8.3 1.6.3 {{#usePlayWS}} - 2.12.1 - 2.12.6.1 + 2.13.4 + 2.13.4.2 2.6.7 {{#openApiNullable}} - 0.2.3 + 0.2.4 {{/openApiNullable}} {{/usePlayWS}} 2.5.0 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 8e8a20e422d..6f9d9e6bb2c 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 @@ -30,12 +30,12 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.10.5" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" vertx_version = "3.4.2" junit_version = "4.13.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" } 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 c32d1152404..099abffe2bb 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,9 +292,9 @@ UTF-8 3.4.2 1.5.22 - 2.10.5 - 2.12.6.1 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 4.13.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache index aeed99cbc1e..c9950a00c6a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache @@ -517,7 +517,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return boolean true if the MediaType represents JSON, false otherwise */ public boolean isJsonMime(MediaType mediaType) { - return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$")); + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); } /** 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 27d2cd43e7f..5d97c7d0f1b 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 @@ -114,10 +114,10 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" spring_boot_version = "2.6.6" - jackson_version = "2.12.7" - jackson_databind_version = "2.12.7" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache index 660e76a1d4c..22faa52f939 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache @@ -148,10 +148,10 @@ UTF-8 1.6.3 2.6.6 - 2.12.7 - 2.12.7 + 2.13.4 + 2.13.4.2 {{#openApiNullable}} - 0.2.3 + 0.2.4 {{/openApiNullable}} 1.3.5 4.13.2 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache index 09893b8df21..c66a9702887 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache @@ -1,6 +1,8 @@ package {{package}}; +{{#models.0}} import {{modelPackage}}.*; +{{/models.0}} import {{package}}.{{classname}}Service; import {{package}}.factories.{{classname}}ServiceFactory; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/apiService.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/apiService.mustache index d395bb8ee2b..0aa3241c26d 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/apiService.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/apiService.mustache @@ -1,7 +1,9 @@ package {{package}}; import {{package}}.*; +{{#models.0}} import {{modelPackage}}.*; +{{/models.0}} import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/apiServiceImpl.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/apiServiceImpl.mustache index af96791e89b..ab4aff25991 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/apiServiceImpl.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/apiServiceImpl.mustache @@ -1,8 +1,9 @@ package {{package}}.impl; import {{package}}.*; +{{#models.0}} import {{modelPackage}}.*; - +{{/models.0}} {{#imports}}import {{import}}; {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index cf48c4834a1..d548a7be1fe 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -96,11 +96,11 @@ import javax.annotation.Generated; {{#virtualService}} @VirtualService {{/virtualService}} -{{^useFeignClient}} +{{#useRequestMappingOnInterface}} {{=<% %>=}} @RequestMapping("${openapi.<%title%>.base-path:<%>defaultBasePath%>}") <%={{ }}=%> -{{/useFeignClient}} +{{/useRequestMappingOnInterface}} public interface {{classname}} { {{#jdk8-default-interface}} {{^isDelegate}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache index 85589bb7b67..d6be388587d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache @@ -58,6 +58,11 @@ import javax.annotation.Generated; {{>generatedAnnotation}} @Controller +{{#useRequestMappingOnController}} +{{=<% %>=}} +@RequestMapping("${openapi.<%title%>.base-path:<%>defaultBasePath%>}") +<%={{ }}=%> +{{/useRequestMappingOnController}} {{#operations}} public class {{classname}}Controller implements {{classname}} { {{#isDelegate}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/converter.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/converter.mustache new file mode 100644 index 00000000000..a331ded633b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/converter.mustache @@ -0,0 +1,34 @@ +package {{configPackage}}; + +{{#models}} + {{#model}} + {{#isEnum}} +import {{modelPackage}}.{{name}}; + {{/isEnum}} + {{/model}} +{{/models}} + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.convert.converter.Converter; + +@Configuration +public class EnumConverterConfiguration { + +{{#models}} +{{#model}} +{{#isEnum}} + @Bean + Converter<{{{dataType}}}, {{name}}> {{classVarName}}Converter() { + return new Converter<{{{dataType}}}, {{name}}>() { + @Override + public {{name}} convert({{{dataType}}} source) { + return {{name}}.fromValue(source); + } + }; + } +{{/isEnum}} +{{/model}} +{{/models}} + +} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache index f00a6c3b6f7..adc5145d080 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache @@ -3,8 +3,6 @@ package {{package}}; import org.springframework.cloud.openfeign.FeignClient; import {{configPackage}}.ClientConfiguration; -{{=<% %>=}} -@FeignClient(name="${<%classVarName%>.name:<%classVarName%>}", url="${<%classVarName%>.url:<%basePath%>}", configuration = ClientConfiguration.class) -<%={{ }}=%> +@FeignClient(name="${{openbrace}}{{classVarName}}.name:{{classVarName}}{{closebrace}}", {{#useFeignClientUrl}}url="${{openbrace}}{{classVarName}}.url:{{basePath}}{{closebrace}}", {{/useFeignClientUrl}}configuration = ClientConfiguration.class) public interface {{classname}}Client extends {{classname}} { } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache index 28a6ea60ac0..23dfcf6759b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache @@ -43,5 +43,5 @@ Mono result = Mono.empty(); {{^examples}} exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}); {{/examples}} - return result.then(Mono.empty()); + return result{{#allParams}}{{#isBodyParam}}{{^isArray}}{{#paramName}}.then({{.}}){{/paramName}}{{/isArray}}{{#isArray}}{{#paramName}}.thenMany({{.}}){{/paramName}}{{/isArray}}{{/isBodyParam}}{{/allParams}}.then(Mono.empty()); {{/reactive}} 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 8de1caf4bfa..eeafa6e8843 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache @@ -5,6 +5,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; {{#useCompareNetObjects}} @@ -112,6 +113,8 @@ namespace {{packageName}}.Client return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } @@ -210,5 +213,40 @@ namespace {{packageName}}.Client 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/modules/openapi-generator/src/main/resources/elm/Api.mustache b/modules/openapi-generator/src/main/resources/elm/Api.mustache index 2890e9deac9..57b78a2620c 100644 --- a/modules/openapi-generator/src/main/resources/elm/Api.mustache +++ b/modules/openapi-generator/src/main/resources/elm/Api.mustache @@ -3,6 +3,7 @@ module Api exposing , request , send , sendWithCustomError + , sendWithCustomExpect , task , map , withBasePath @@ -55,13 +56,18 @@ send toMsg req = sendWithCustomError : (Http.Error -> e) -> (Result e a -> msg) -> Request a -> Cmd msg -sendWithCustomError mapError toMsg (Request req) = +sendWithCustomError mapError toMsg req = + sendWithCustomExpect (expectJson mapError toMsg) req + + +sendWithCustomExpect : (Json.Decode.Decoder a -> Http.Expect msg) -> Request a -> Cmd msg +sendWithCustomExpect expect (Request req) = Http.request { method = req.method , headers = req.headers , url = Url.Builder.crossOrigin req.basePath req.pathParams req.queryParams , body = req.body - , expect = expectJson mapError toMsg req.decoder + , expect = expect req.decoder , timeout = req.timeout , tracker = req.tracker } diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/go-mod.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/go-mod.mustache index 4b31aa41c83..c1a4ac15ece 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/go-mod.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/go-mod.mustache @@ -2,4 +2,4 @@ module github.com/{{{gitUserId}}}/{{{gitRepoId}}} go 1.16 -require github.com/labstack/echo/v4 v4.2.0 +require github.com/labstack/echo/v4 v4.9.0 diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index c2c977178bb..44fbbcf4f95 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -385,7 +385,8 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class newErr.error = err.Error() return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v {{^-last}} return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr {{/-last}} diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index 62f75508bae..d5e45dfb03c 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -127,7 +127,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { // Check the type is as expected. if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) } return nil } @@ -514,7 +514,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e } if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) + err = fmt.Errorf("invalid body type %s\n", contentType) return nil, err } return bodyBuf, nil @@ -616,3 +616,23 @@ func (e GenericOpenAPIError) Body() []byte { func (e GenericOpenAPIError) Model() interface{} { return e.model } + +// format error message using title and detail when model implements rfc7807 +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()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + + // status title (detail) + return fmt.Sprintf("%s %s", status, str) +} diff --git a/modules/openapi-generator/src/main/resources/go/configuration.mustache b/modules/openapi-generator/src/main/resources/go/configuration.mustache index 610f9edc5d2..088e9202cf8 100644 --- a/modules/openapi-generator/src/main/resources/go/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/go/configuration.mustache @@ -207,7 +207,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { // URL formats template on a index using given variables func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) } server := sc[index] url := server.URL @@ -222,7 +222,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri } } if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) } url = strings.Replace(url, "{"+name+"}", value, -1) } else { diff --git a/modules/openapi-generator/src/main/resources/go/model_anyof.mustache b/modules/openapi-generator/src/main/resources/go/model_anyof.mustache index f1d8c57c85f..3b221d80fb6 100644 --- a/modules/openapi-generator/src/main/resources/go/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_anyof.mustache @@ -22,7 +22,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { var jsonDict map[string]interface{} err = json.Unmarshal(data, &jsonDict) if err != nil { - return fmt.Errorf("Failed to unmarshal JSON into map for the discriminator lookup.") + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") } {{/-first}} @@ -59,7 +59,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { } {{/anyOf}} - return fmt.Errorf("Data failed to match schemas in anyOf({{classname}})") + return fmt.Errorf("data failed to match schemas in anyOf({{classname}})") } // Marshal data from the first non-nil pointers in the struct to JSON diff --git a/modules/openapi-generator/src/main/resources/go/model_oneof.mustache b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache index 14bc3ada757..3f70f611683 100644 --- a/modules/openapi-generator/src/main/resources/go/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache @@ -33,7 +33,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { var jsonDict map[string]interface{} err = newStrictDecoder(data).Decode(&jsonDict) if err != nil { - return fmt.Errorf("Failed to unmarshal JSON into map for the discriminator lookup.") + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") } {{/-first}} @@ -45,7 +45,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { return nil // data stored in dst.{{{modelName}}}, return on the first match } else { dst.{{{modelName}}} = nil - return fmt.Errorf("Failed to unmarshal {{classname}} as {{{modelName}}}: %s", err.Error()) + return fmt.Errorf("failed to unmarshal {{classname}} as {{{modelName}}}: %s", err.Error()) } } @@ -75,11 +75,11 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} = nil {{/oneOf}} - return fmt.Errorf("Data matches more than one schema in oneOf({{classname}})") + return fmt.Errorf("data matches more than one schema in oneOf({{classname}})") } else if match == 1 { return nil // exactly one match } else { // no match - return fmt.Errorf("Data failed to match schemas in oneOf({{classname}})") + return fmt.Errorf("data failed to match schemas in oneOf({{classname}})") } {{/discriminator}} {{/useOneOfDiscriminatorLookup}} @@ -106,11 +106,11 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { dst.{{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}} = nil {{/oneOf}} - return fmt.Errorf("Data matches more than one schema in oneOf({{classname}})") + return fmt.Errorf("data matches more than one schema in oneOf({{classname}})") } else if match == 1 { return nil // exactly one match } else { // no match - return fmt.Errorf("Data failed to match schemas in oneOf({{classname}})") + return fmt.Errorf("data failed to match schemas in oneOf({{classname}})") } {{/useOneOfDiscriminatorLookup}} } diff --git a/modules/openapi-generator/src/main/resources/go/model_simple.mustache b/modules/openapi-generator/src/main/resources/go/model_simple.mustache index 7a9b2565444..1f41f195532 100644 --- a/modules/openapi-generator/src/main/resources/go/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_simple.mustache @@ -122,8 +122,13 @@ func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} { // Deprecated {{/deprecated}} func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{vendorExtensions.x-go-base-type}}, bool) { - if o == nil{{#isNullable}}{{#vendorExtensions.x-golang-is-container}} || o.{{name}} == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { - return nil, false + if o == nil{{#isNullable}}{{#vendorExtensions.x-golang-is-container}} || isNil(o.{{name}}){{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { +{{^isFreeFormObject}} + return nil, false + {{/isFreeFormObject}} + {{#isFreeFormObject}} + return {{vendorExtensions.x-go-base-type}}{}, false + {{/isFreeFormObject}} } {{#isNullable}} {{#vendorExtensions.x-golang-is-container}} @@ -163,7 +168,7 @@ func (o *{{classname}}) Set{{name}}(v {{vendorExtensions.x-go-base-type}}) { // Deprecated {{/deprecated}} func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} { - if o == nil{{^isNullable}} || o.{{name}} == nil{{/isNullable}}{{#isNullable}}{{^vendorExtensions.x-golang-is-container}} || o.{{name}}.Get() == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { + if o == nil{{^isNullable}} || isNil(o.{{name}}){{/isNullable}}{{#isNullable}}{{^vendorExtensions.x-golang-is-container}} || isNil(o.{{name}}.Get()){{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { var ret {{vendorExtensions.x-go-base-type}} return ret } @@ -189,8 +194,13 @@ func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} { // Deprecated {{/deprecated}} func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{vendorExtensions.x-go-base-type}}, bool) { - if o == nil{{^isNullable}} || o.{{name}} == nil{{/isNullable}}{{#isNullable}}{{#vendorExtensions.x-golang-is-container}} || o.{{name}} == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { - return nil, false + if o == nil{{^isNullable}} || isNil(o.{{name}}){{/isNullable}}{{#isNullable}}{{#vendorExtensions.x-golang-is-container}} || isNil(o.{{name}}){{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { + {{^isFreeFormObject}} + return nil, false + {{/isFreeFormObject}} + {{#isFreeFormObject}} + return {{vendorExtensions.x-go-base-type}}{}, false + {{/isFreeFormObject}} } {{#isNullable}} {{#vendorExtensions.x-golang-is-container}} @@ -207,7 +217,7 @@ func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/is // Has{{name}} returns a boolean if a field has been set. func (o *{{classname}}) Has{{name}}() bool { - if o != nil && {{^isNullable}}o.{{name}} != nil{{/isNullable}}{{#isNullable}}{{#vendorExtensions.x-golang-is-container}}o.{{name}} != nil{{/vendorExtensions.x-golang-is-container}}{{^vendorExtensions.x-golang-is-container}}o.{{name}}.IsSet(){{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { + if o != nil && {{^isNullable}}!isNil(o.{{name}}){{/isNullable}}{{#isNullable}}{{#vendorExtensions.x-golang-is-container}}isNil(o.{{name}}){{/vendorExtensions.x-golang-is-container}}{{^vendorExtensions.x-golang-is-container}}o.{{name}}.IsSet(){{/vendorExtensions.x-golang-is-container}}{{/isNullable}} { return true } @@ -285,7 +295,7 @@ func (o {{classname}}) MarshalJSON() ([]byte, error) { {{/isNullable}} {{! if argument is not nullable, don't set it if it is nil}} {{^isNullable}} - if {{#required}}true{{/required}}{{^required}}o.{{name}} != nil{{/required}} { + if {{#required}}true{{/required}}{{^required}}!isNil(o.{{name}}){{/required}} { toSerialize["{{baseName}}"] = o.{{name}} } {{/isNullable}} diff --git a/modules/openapi-generator/src/main/resources/go/signing.mustache b/modules/openapi-generator/src/main/resources/go/signing.mustache index d8c5b376e9e..6400d0265ea 100644 --- a/modules/openapi-generator/src/main/resources/go/signing.mustache +++ b/modules/openapi-generator/src/main/resources/go/signing.mustache @@ -126,26 +126,26 @@ func (h *HttpSignatureAuth) SetPrivateKey(privateKey string) error { // are invalid. func (h *HttpSignatureAuth) ContextWithValue(ctx context.Context) (context.Context, error) { if h.KeyId == "" { - return nil, fmt.Errorf("Key ID must be specified") + return nil, fmt.Errorf("key ID must be specified") } if h.PrivateKeyPath == "" && h.privateKey == nil { - return nil, fmt.Errorf("Private key path must be specified") + return nil, fmt.Errorf("private key path must be specified") } if _, ok := supportedSigningSchemes[h.SigningScheme]; !ok { - return nil, fmt.Errorf("Invalid signing scheme: '%v'", h.SigningScheme) + return nil, fmt.Errorf("invalid signing scheme: '%v'", h.SigningScheme) } m := make(map[string]bool) for _, h := range h.SignedHeaders { if strings.EqualFold(h, HttpHeaderAuthorization) { - return nil, fmt.Errorf("Signed headers cannot include the 'Authorization' header") + return nil, fmt.Errorf("signed headers cannot include the 'Authorization' header") } m[h] = true } if len(m) != len(h.SignedHeaders) { - return nil, fmt.Errorf("List of signed headers cannot have duplicate names") + return nil, fmt.Errorf("list of signed headers cannot have duplicate names") } if h.SignatureMaxValidity < 0 { - return nil, fmt.Errorf("Signature max validity must be a positive value") + return nil, fmt.Errorf("signature max validity must be a positive value") } if err := h.loadPrivateKey(); err != nil { return nil, err @@ -168,7 +168,7 @@ func (h *HttpSignatureAuth) GetPublicKey() (crypto.PublicKey, error) { default: // Do not change '%T' to anything else such as '%v'! // The value of the private key must not be returned. - return nil, fmt.Errorf("Unsupported key: %T", h.privateKey) + return nil, fmt.Errorf("unsupported key: %T", h.privateKey) } } @@ -181,7 +181,7 @@ func (h *HttpSignatureAuth) loadPrivateKey() (err error) { var file *os.File file, err = os.Open(h.PrivateKeyPath) if err != nil { - return fmt.Errorf("Cannot load private key '%s'. Error: %v", h.PrivateKeyPath, err) + return fmt.Errorf("cannot load private key '%s'. Error: %v", h.PrivateKeyPath, err) } defer func() { err = file.Close() @@ -199,7 +199,7 @@ func (h *HttpSignatureAuth) parsePrivateKey(priv []byte) error { pemBlock, _ := pem.Decode(priv) if pemBlock == nil { // No PEM data has been found. - return fmt.Errorf("File '%s' does not contain PEM data", h.PrivateKeyPath) + return fmt.Errorf("file '%s' does not contain PEM data", h.PrivateKeyPath) } var privKey []byte var err error @@ -225,7 +225,7 @@ func (h *HttpSignatureAuth) parsePrivateKey(priv []byte) error { return err } default: - return fmt.Errorf("Key '%s' is not supported", pemBlock.Type) + return fmt.Errorf("key '%s' is not supported", pemBlock.Type) } return nil } @@ -248,7 +248,7 @@ func SignRequest( auth HttpSignatureAuth) error { if auth.privateKey == nil { - return fmt.Errorf("Private key is not set") + return fmt.Errorf("private key is not set") } now := time.Now() date := now.UTC().Format(http.TimeFormat) @@ -262,7 +262,7 @@ func SignRequest( var expiresUnix float64 if auth.SignatureMaxValidity < 0 { - return fmt.Errorf("Signature validity must be a positive value") + return fmt.Errorf("signature validity must be a positive value") } if auth.SignatureMaxValidity > 0 { e := now.Add(auth.SignatureMaxValidity) @@ -278,10 +278,10 @@ func SignRequest( h = crypto.SHA256 prefix = "SHA-256=" default: - return fmt.Errorf("Unsupported signature scheme: %v", auth.SigningScheme) + return fmt.Errorf("unsupported signature scheme: %v", auth.SigningScheme) } if !h.Available() { - return fmt.Errorf("Hash '%v' is not available", h) + return fmt.Errorf("hash '%v' is not available", h) } // Build the "(request-target)" signature header. @@ -308,7 +308,7 @@ func SignRequest( m[h] = true } if len(m) != len(signedHeaders) { - return fmt.Errorf("List of signed headers must not have any duplicates") + return fmt.Errorf("list of signed headers must not have any duplicates") } hasCreatedParameter := false hasExpiresParameter := false @@ -317,7 +317,7 @@ func SignRequest( var value string switch header { case strings.ToLower(HttpHeaderAuthorization): - return fmt.Errorf("Cannot include the 'Authorization' header as a signed header.") + return fmt.Errorf("cannot include the 'Authorization' header as a signed header") case HttpSignatureParameterRequestTarget: value = requestTarget case HttpSignatureParameterCreated: @@ -325,7 +325,7 @@ func SignRequest( hasCreatedParameter = true case HttpSignatureParameterExpires: if auth.SignatureMaxValidity.Nanoseconds() == 0 { - return fmt.Errorf("Cannot set '(expires)' signature parameter. SignatureMaxValidity is not configured.") + return fmt.Errorf("cannot set '(expires)' signature parameter. SignatureMaxValidity is not configured") } value = fmt.Sprintf("%.3f", expiresUnix) hasExpiresParameter = true @@ -361,7 +361,7 @@ func SignRequest( if v, ok = r.Header[canonicalHeader]; !ok { // If a header specified in the headers parameter cannot be matched with // a provided header in the message, the implementation MUST produce an error. - return fmt.Errorf("Header '%s' does not exist in the request", canonicalHeader) + return fmt.Errorf("header '%s' does not exist in the request", canonicalHeader) } // If there are multiple instances of the same header field, all // header field values associated with the header field MUST be @@ -376,7 +376,7 @@ func SignRequest( fmt.Fprintf(&sb, "%s: %s", header, value) } if expiresUnix != 0 && !hasExpiresParameter { - return fmt.Errorf("SignatureMaxValidity is specified, but '(expired)' parameter is not present") + return fmt.Errorf("signatureMaxValidity is specified, but '(expired)' parameter is not present") } msg := []byte(sb.String()) msgHash := h.New() @@ -394,14 +394,14 @@ func SignRequest( case "", HttpSigningAlgorithmRsaPSS: signature, err = rsa.SignPSS(rand.Reader, key, h, d, nil) default: - return fmt.Errorf("Unsupported signing algorithm: '%s'", auth.SigningAlgorithm) + return fmt.Errorf("unsupported signing algorithm: '%s'", auth.SigningAlgorithm) } case *ecdsa.PrivateKey: signature, err = key.Sign(rand.Reader, d, h) case ed25519.PrivateKey: // requires go 1.13 signature, err = key.Sign(rand.Reader, msg, crypto.Hash(0)) default: - return fmt.Errorf("Unsupported private key") + return fmt.Errorf("unsupported private key") } if err != nil { return err diff --git a/modules/openapi-generator/src/main/resources/go/utils.mustache b/modules/openapi-generator/src/main/resources/go/utils.mustache index 5ae789a996c..cc42e879c85 100644 --- a/modules/openapi-generator/src/main/resources/go/utils.mustache +++ b/modules/openapi-generator/src/main/resources/go/utils.mustache @@ -3,6 +3,7 @@ package {{packageName}} import ( "encoding/json" + "reflect" "time" ) @@ -317,3 +318,17 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + +// isNil checks if an input is nil +func isNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache index d6dca22f5fc..d805869f5ae 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/README.mustache @@ -20,8 +20,8 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requires {{#jvm}} -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 {{/jvm}} {{#multiplatform}} * Kotlin 1.5.10 diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/additionalModelTypeAnnotations.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/additionalModelTypeAnnotations.mustache new file mode 100644 index 00000000000..f4871c02cc2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/additionalModelTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalModelTypeAnnotations}}{{{.}}} +{{/additionalModelTypeAnnotations}} \ No newline at end of file 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 5716f8656c3..b43ef7f39f6 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 @@ -11,7 +11,7 @@ wrapper { buildscript { ext.kotlin_version = '1.6.10' {{#jvm-ktor}} - ext.ktor_version = '2.0.3' + ext.ktor_version = '2.1.2' {{/jvm-ktor}} {{#jvm-retrofit2}} ext.retrofitVersion = '2.9.0' @@ -25,6 +25,9 @@ buildscript { {{#useRxJava3}} ext.rxJava3Version = '3.0.12' {{/useRxJava3}} + {{#jvm-vertx}} + ext.vertx_version = "4.3.3" + {{/jvm-vertx}} repositories { maven { url "https://repo1.maven.org/maven2" } @@ -149,6 +152,15 @@ dependencies { implementation "com.squareup.retrofit2:converter-scalars:$retrofitVersion" {{/jvm-retrofit2}} testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" + {{#jvm-vertx}} + implementation "io.vertx:vertx-web-client:$vertx_version" + implementation "io.vertx:vertx-core:$vertx_version" + implementation "io.vertx:vertx-lang-kotlin:$vertx_version" + implementation "io.vertx:vertx-uri-template:$vertx_version" + {{#useCoroutines}} + implementation "io.vertx:vertx-lang-kotlin-coroutines:$vertx_version" + {{/useCoroutines}} + {{/jvm-vertx}} } {{#kotlinx_serialization}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache index 8d2c28acd4a..0ddf4793a44 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache @@ -61,6 +61,7 @@ import {{packageName}}.infrastructure.ITransformForStorage {{#isDeprecated}} @Deprecated(message = "This schema is deprecated.") {{/isDeprecated}} +{{>additionalModelTypeAnnotations}} {{#nonPublicApi}}internal {{/nonPublicApi}}{{#discriminator}}interface{{/discriminator}}{{^discriminator}}data class{{/discriminator}} {{classname}}{{^discriminator}} ( {{#allVars}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache index 51a0a5f504e..301af9194f8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache @@ -12,6 +12,7 @@ import io.ktor.client.request.parameter import io.ktor.client.request.request import io.ktor.client.request.setBody import io.ktor.client.statement.HttpResponse +import io.ktor.http.contentType import io.ktor.http.HttpHeaders import io.ktor.http.HttpMethod import io.ktor.http.Parameters @@ -34,11 +35,6 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com.fasterxml.jackson.core.util.DefaultIndenter import com.fasterxml.jackson.core.util.DefaultPrettyPrinter {{/jackson}} -import org.openapitools.client.auth.ApiKeyAuth -import org.openapitools.client.auth.Authentication -import org.openapitools.client.auth.HttpBasicAuth -import org.openapitools.client.auth.HttpBearerAuth -import org.openapitools.client.auth.OAuth import {{packageName}}.auth.* {{#nonPublicApi}}internal {{/nonPublicApi}}open class ApiClient( @@ -111,7 +107,7 @@ import {{packageName}}.auth.* * @param username Username */ fun setUsername(username: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.username = username } @@ -122,7 +118,7 @@ import {{packageName}}.auth.* * @param password Password */ fun setPassword(password: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.password = password } @@ -134,7 +130,7 @@ import {{packageName}}.auth.* * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKey(apiKey: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKey = apiKey } @@ -146,7 +142,7 @@ import {{packageName}}.auth.* * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKeyPrefix = apiKeyPrefix } @@ -157,7 +153,7 @@ import {{packageName}}.auth.* * @param accessToken Access token */ fun setAccessToken(accessToken: String) { - val auth = authentications.values.firstOrNull { it is OAuth } as OAuth? + val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth? ?: throw Exception("No OAuth2 authentication configured") auth.accessToken = accessToken } @@ -168,7 +164,7 @@ import {{packageName}}.auth.* * @param bearerToken The bearer token. */ fun setBearerToken(bearerToken: String) { - val auth = authentications.values.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? ?: throw Exception("No Bearer authentication configured") auth.bearerToken = bearerToken } @@ -199,8 +195,9 @@ import {{packageName}}.auth.* } this.method = requestConfig.method.httpMethod headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } - if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { setBody(body) + } } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache new file mode 100644 index 00000000000..04e6e387819 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache @@ -0,0 +1,232 @@ +{{>licenseInfo}} +package {{apiPackage}} + +import java.io.IOException + +{{#imports}}import {{import}} +{{/imports}} + +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.type.TypeReference +{{/jackson}} +{{#gson}} +import com.google.gson.reflect.TypeToken +import com.google.gson.annotations.SerializedName +{{/gson}} +{{#moshi}} +import com.squareup.moshi.Json +{{/moshi}} + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + +{{#useCoroutines}} +import io.vertx.kotlin.coroutines.await +import io.vertx.kotlin.coroutines.dispatcher +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +{{/useCoroutines}} + +import {{packageName}}.infrastructure.* + +@Suppress ("UNUSED") +{{#operations}} +{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + {{#operation}} + {{#allParams}} + {{#isEnum}} + /** + * enum for parameter {{paramName}} + */ + {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}_{{operationId}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { + {{^enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{#moshi}} + @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + {{/moshi}} + {{#gson}} + @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + {{/gson}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + {{/jackson}} + {{#kotlinx_serialization}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + {{/kotlinx_serialization}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} + {{#enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{^-last}} + {{#moshi}} + @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/moshi}} + {{#gson}} + @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/gson}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/jackson}} + {{#kotlinx_serialization}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/kotlinx_serialization}} + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} + } + + {{/isEnum}} + {{/allParams}} + /** + * {{summary}} + * {{notes}} + {{#allParams}}* @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}} + {{/allParams}}* @return {{#returnType}}{{{returnType}}}{{#nullableReturnType}}{{^isResponseOptional}} or null{{/isResponseOptional}}{{/nullableReturnType}}{{#isResponseOptional}} or null{{/isResponseOptional}}{{/returnType}}{{^returnType}}void{{/returnType}} + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */{{#returnType}} + @Suppress("UNCHECKED_CAST"){{/returnType}} + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + {{#isDeprecated}} + @Deprecated(message = "This operation is deprecated.") + {{/isDeprecated}} + {{#useCoroutines}}suspend {{/useCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{^useCoroutines}}Future<{{/useCoroutines}}{{#returnType}}{{{returnType}}}{{#nullableReturnType}}{{^isResponseOptional}}?{{/isResponseOptional}}{{/nullableReturnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^useCoroutines}}>{{/useCoroutines}} { + return {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> {{#returnType}}(localVarResponse as Success<*>).data as {{{returnType}}}{{#nullableReturnType}}{{^isResponseOptional}}?{{/isResponseOptional}}{{/nullableReturnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Unit{{/returnType}} + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }{{#useCoroutines}}.await(){{/useCoroutines}} + } + + /** + * {{summary}} + * {{notes}} + {{#allParams}}* @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}} + {{/allParams}}* @return ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */{{#returnType}} + @Suppress("UNCHECKED_CAST"){{/returnType}} + @Throws(IllegalStateException::class, IOException::class) + {{#isDeprecated}} + @Deprecated(message = "This operation is deprecated.") + {{/isDeprecated}} + fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.{{httpMethod}}, UriTemplate.of("$basePath{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}})) + + {{#hasFormParams}}request.putHeader("Content-Type", {{^consumes}}"multipart/form-data"{{/consumes}}{{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}){{/hasFormParams}} + {{#headerParams}}{{{paramName}}}{{^required}}?{{/required}}.apply { request.putHeader("{{baseName}}", {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}})}{{/headerParams}} + {{^hasFormParams}}{{#hasConsumes}} + {{#consumes}} + request.putHeader("Content-Type", "{{{mediaType}}}") + {{/consumes}} + {{/hasConsumes}}{{/hasFormParams}} + {{#hasProduces}}request.putHeader("Accept", "{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}"){{/hasProduces}} + + {{#hasFormParams}} + val form = io.vertx.core.MultiMap.caseInsensitiveMultiMap(); + {{#formParams}} + {{{paramName}}}{{^required}}?{{/required}}.let { form.add("{{{baseName}}}", {{{paramName}}}{{#isEnum}}.value{{/isEnum}}{{^isString}}.toString(){{/isString}}) } + {{/formParams}} + {{/hasFormParams}} + + {{#hasQueryParams}} + {{#queryParams}} + {{{paramName}}}{{^required}}?{{/required}}.let { request.queryParams().add("{{baseName}}", {{#isContainer}}toMultiValue(it.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString(it){{/isDateTime}}{{#isDate}}parseDateToQueryString(it){{/isDate}}{{^isDateTime}}{{^isDate}}it.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) } + {{/queryParams}} + {{/hasQueryParams}} + + {{#authMethods}} + {{#isApiKey}} + if (apiKey["{{keyParamName}}"] != null) { + if (apiKeyPrefix["{{keyParamName}}"] != null) { + {{#isKeyInHeader}} + request.putHeader("{{keyParamName}}", apiKeyPrefix["{{keyParamName}}"]!! + " " + apiKey["{{keyParamName}}"]!!) + {{/isKeyInHeader}} + {{#isKeyInQuery}} + request.queryParams().add("{{keyParamName}}", apiKeyPrefix["{{keyParamName}}"]!! + " " + apiKey["{{keyParamName}}"]!!) + {{/isKeyInQuery}} + } else { + {{#isKeyInHeader}} + request.putHeader("{{keyParamName}}", apiKey["{{keyParamName}}"]!!) + {{/isKeyInHeader}} + {{#isKeyInQuery}} + request.queryParams().add("{{keyParamName}}", apiKey["{{keyParamName}}"]!!) + {{/isKeyInQuery}} + } + } + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + username?.let { username -> + password?.let { password -> + request.basicAuthentication(username, password) + } + } + {{/isBasicBasic}} + {{#isBasicBearer}} + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + {{/isOAuth}} + {{/authMethods}} + + return request + {{#hasBodyParam}} + .sendBuffer(responseBody({{#bodyParams}}{{{paramName}}}{{/bodyParams}})) + {{/hasBodyParam}} + {{^hasBodyParam}} + .send() + {{/hasBodyParam}} + .map { + val apiResponse: ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}> = handleResponse(it) + apiResponse + } + } + + {{/operation}} + + private inline fun responseBody(body: T): Buffer { + {{#moshi}} + return Buffer.buffer(Serializer.moshi.adapter(T::class.java).toJson(body)) + {{/moshi}} + {{#gson}} + return Buffer.buffer(Serializer.gson.toJson(body, T::class.java)) + {{/gson}} + {{#jackson}} + return Buffer.buffer(Serializer.jacksonObjectMapper.writeValueAsBytes(body)) + {{/jackson}} + } + +} +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiClient.kt.mustache new file mode 100644 index 00000000000..dacce6f4742 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiClient.kt.mustache @@ -0,0 +1,110 @@ +package {{packageName}}.infrastructure + +import io.vertx.core.Vertx +import io.vertx.core.buffer.Buffer +import java.nio.charset.StandardCharsets +{{#jackson}} +import com.fasterxml.jackson.core.type.TypeReference +{{/jackson}} +{{#gson}} +import com.google.gson.reflect.TypeToken +{{/gson}} + +{{#nonPublicApi}}internal {{/nonPublicApi}}open class ApiClient(val basePath: kotlin.String = defaultBasePath, val accessToken: String? = null, val apiKey: MutableMap = mutableMapOf(), val apiKeyPrefix: MutableMap = mutableMapOf(), var username: String? = null, var password: String? = null, val vertx: Vertx) { + companion object { + const val baseUrlKey = "{{packageName}}.baseUrl" + + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty(baseUrlKey, "{{{basePath}}}") + } + } + + protected inline fun handleResponse(response: io.vertx.ext.web.client.HttpResponse): ApiResponse { + val code = response.statusCode() + val headers = response.headers().associate { it.key to listOf(it.value) } + val contentType = headers["Content-Type"]?.firstOrNull()?.substringBefore(";")?.lowercase(java.util.Locale.getDefault()) + + return when (code) { + in 100..199 -> Informational( + response.statusMessage(), + code, + headers + ) + in 200 .. 299 -> Success( + responseBody(response.body(), contentType), + code, + headers + ) + in 300..399 -> Redirection( + code, + headers + ) + in 400..499 -> ClientError( + response.statusMessage(), + response.bodyAsString(), + code, + headers + ) + else -> ServerError( + response.statusMessage(), + response.bodyAsString(), + code, + headers + ) + } + } + + protected inline fun responseBody(body: Buffer?, mediaType: String? = "application/json"): T? { + body ?: return null + + val bodyContent = String(body.bytes, StandardCharsets.UTF_8) + if (bodyContent.isEmpty()) { + return null + } + + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + {{#moshi}}Serializer.moshi.adapter(T::class.java).fromJson(bodyContent){{/moshi}}{{! + }}{{#gson}}Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()){{/gson}}{{! + }}{{#jackson}}Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}){{/jackson}}{{! + }}{{#kotlinx_serialization}}Serializer.kotlinxSerializationJson.decodeFromString(bodyContent){{/kotlinx_serialization}} + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + protected fun encodeURIComponent(parameter: String): String { + return try { + java.net.URLEncoder.encode(parameter, java.nio.charset.StandardCharsets.UTF_8.name()) + } catch (e: java.io.UnsupportedEncodingException) { + parameter + } + } + + protected inline fun parseDateToQueryString(value : T): String { + {{#toJson}} + /* + .replace("\"", "") converts the json object string to an actual string for the query parameter. + The moshi or gson adapter allows a more generic solution instead of trying to use a native + formatter. It also easily allows to provide a simple way to define a custom date format pattern + inside a gson/moshi adapter. + */ + {{#moshi}} + return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") + {{/moshi}} + {{#gson}} + return Serializer.gson.toJson(value, T::class.java).replace("\"", "") + {{/gson}} + {{#jackson}} + return Serializer.jacksonObjectMapper.writeValueAsString(value).replace("\"", "") + {{/jackson}} + {{#kotlinx_serialization}} + return Serializer.kotlinxSerializationJson.encodeToString(value).replace("\"", "") + {{/kotlinx_serialization}} + {{/toJson}} + {{^toJson}} + return value.toString() + {{/toJson}} + } + +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiResponse.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiResponse.kt.mustache new file mode 100644 index 00000000000..d529ad5599f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiResponse.kt.mustache @@ -0,0 +1,43 @@ +package {{packageName}}.infrastructure + +{{#nonPublicApi}}internal {{/nonPublicApi}}enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +{{#nonPublicApi}}internal {{/nonPublicApi}}interface Response + +{{#nonPublicApi}}internal {{/nonPublicApi}}abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +{{#nonPublicApi}}internal {{/nonPublicApi}}class Success( + val data: T{{#nullableReturnType}}?{{/nullableReturnType}}, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +{{#nonPublicApi}}internal {{/nonPublicApi}}class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +{{#nonPublicApi}}internal {{/nonPublicApi}}class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +{{#nonPublicApi}}internal {{/nonPublicApi}}class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +{{#nonPublicApi}}internal {{/nonPublicApi}}class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/Errors.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/Errors.kt.mustache new file mode 100644 index 00000000000..7c428ad655f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/Errors.kt.mustache @@ -0,0 +1,18 @@ +@file:Suppress("unused") +package {{packageName}}.infrastructure + +import java.lang.RuntimeException + +{{#nonPublicApi}}internal {{/nonPublicApi}}open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + {{#nonPublicApi}}internal {{/nonPublicApi}}companion object { + private const val serialVersionUID: Long = 123L + } +} + +{{#nonPublicApi}}internal {{/nonPublicApi}}open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + {{#nonPublicApi}}internal {{/nonPublicApi}}companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache index bc5d9b19508..bbed97d77ae 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache @@ -4,13 +4,13 @@ import io.ktor.client.HttpClient import io.ktor.client.HttpClientConfig import io.ktor.client.engine.HttpClientEngine import io.ktor.client.plugins.contentnegotiation.ContentNegotiation -import io.ktor.serialization.kotlinx.json.* import io.ktor.client.request.* import io.ktor.client.request.forms.FormDataContent import io.ktor.client.request.forms.MultiPartFormDataContent import io.ktor.client.request.header import io.ktor.client.request.parameter import io.ktor.client.statement.HttpResponse +import io.ktor.serialization.kotlinx.json.json import io.ktor.http.* import io.ktor.http.content.PartData import kotlin.Unit @@ -153,9 +153,9 @@ import {{packageName}}.auth.* } this.method = requestConfig.method.httpMethod headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } - if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { this.setBody(body) - + } } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache index 215a291253f..84e4637d60e 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache @@ -9,7 +9,7 @@ import java.io.Serializable /** * {{{description}}} {{#vars}} - * @param {{name}} {{{description}}} + * @param {{{name}}} {{{description}}} {{/vars}} */ {{#parcelizeModels}} @@ -37,7 +37,7 @@ data class {{classname}}( * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ - enum class {{nameInCamelCase}}(val value: {{dataType}}){ + enum class {{{nameInCamelCase}}}(val value: {{{dataType}}}){ {{#allowableValues}} {{#enumVars}} {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/data_class_opt_var.mustache index df50e9867aa..b2e7cc3b409 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/data_class_opt_var.mustache @@ -1,4 +1,4 @@ {{#description}} /* {{{.}}} */ {{/description}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInCamelCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/data_class_req_var.mustache index 0da9cbfe3c8..d3732ebad05 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/data_class_req_var.mustache @@ -1,4 +1,4 @@ {{#description}} /* {{{.}}} */ {{/description}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInCamelCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/php/HeaderSelector.mustache b/modules/openapi-generator/src/main/resources/php/HeaderSelector.mustache index 5d62a7b5b9d..1921b061015 100644 --- a/modules/openapi-generator/src/main/resources/php/HeaderSelector.mustache +++ b/modules/openapi-generator/src/main/resources/php/HeaderSelector.mustache @@ -1,6 +1,6 @@ selectContentTypeHeader($contentTypes); + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } + + $headers['Content-Type'] = $contentType; + } + return $headers; } /** - * @param string[] $accept - * @return array - */ - public function selectHeadersForMultipart($accept) - { - $headers = $this->selectHeaders($accept, []); - - unset($headers['Content-Type']); - return $headers; - } - - /** - * Return the header 'Accept' based on an array of Accept provided + * Return the header 'Accept' based on an array of Accept provided. * * @param string[] $accept Array of header * * @return null|string Accept (e.g. application/json) */ - private function selectAcceptHeader($accept) + private function selectAcceptHeader(array $accept): ?string { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + # filter out empty entries + $accept = array_filter($accept); + + if (count($accept) === 0) { return null; - } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { - return implode(',', $jsonAccept); - } else { + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + if (count($headersWithJson) === 0) { return implode(',', $accept); } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); } /** - * Return the content type based on an array of content-type provided - * - * @param string[] $contentType Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - private function selectContentTypeHeader($contentType) + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { - return 'application/json'; - } else { - return implode(',', $contentType); + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); + } + + /** + * Given an Accept header, returns an associative array splitting the header and its weight + * + * @param string $header "Accept" Header + * + * @return array with the header and its weight + */ + private function getHeaderAndWeight(string $header): array + { + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; + } else { + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; + } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; + } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); } } diff --git a/modules/openapi-generator/src/main/resources/php/api.mustache b/modules/openapi-generator/src/main/resources/php/api.mustache index 41c22daee04..a9893bf9e3f 100644 --- a/modules/openapi-generator/src/main/resources/php/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/api.mustache @@ -60,7 +60,16 @@ use {{invokerPackage}}\ObjectSerializer; */ protected $hostIndex; - /** + /** @var string[] $contentTypes **/ + public const contentTypes = [{{#operation}} + '{{{operationId}}}' => [{{#consumes}} + '{{{mediaType}}}',{{/consumes}} + {{^consumes}} + 'application/json', +{{/consumes}} ],{{/operation}} + ]; + +/** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -151,6 +160,7 @@ use {{invokerPackage}}\ObjectSerializer; * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. {{/-first}} {{/servers}} + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation * * @throws \{{invokerPackage}}\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -159,9 +169,9 @@ use {{invokerPackage}}\ObjectSerializer; * @deprecated {{/isDeprecated}} */ - public function {{operationId}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}?int $hostIndex = null, array $variables = []{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + public function {{operationId}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { - {{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}$hostIndex, $variables{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} + {{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} return $response;{{/returnType}} } @@ -209,6 +219,7 @@ use {{invokerPackage}}\ObjectSerializer; * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. {{/-first}} {{/servers}} + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation * * @throws \{{invokerPackage}}\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -217,9 +228,9 @@ use {{invokerPackage}}\ObjectSerializer; * @deprecated {{/isDeprecated}} */ - public function {{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}?int $hostIndex = null, array $variables = []{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + public function {{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { - $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}$hostIndex, $variables{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); + $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); try { $options = $this->createHttpClientOption(); @@ -261,8 +272,8 @@ use {{invokerPackage}}\ObjectSerializer; switch($statusCode) { {{/-first}} - {{#dataType}}{{^isRange}} - {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + {{#dataType}} + {{^isRange}}{{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} if ('{{{dataType}}}' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -276,8 +287,8 @@ use {{invokerPackage}}\ObjectSerializer; ObjectSerializer::deserialize($content, '{{{dataType}}}', []), $response->getStatusCode(), $response->getHeaders() - ]; - {{/isRange}}{{/dataType}} + ];{{/isRange}} + {{/dataType}} {{#-last}} } {{/-last}} @@ -307,16 +318,16 @@ use {{invokerPackage}}\ObjectSerializer; } catch (ApiException $e) { switch ($e->getCode()) { {{#responses}} - {{#dataType}}{{^isRange}} - {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + {{#dataType}} + {{^isRange}}{{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} $data = ObjectSerializer::deserialize( $e->getResponseBody(), '{{{dataType}}}', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; - {{/isRange}}{{/dataType}} + break;{{/isRange}} + {{/dataType}} {{/responses}} } throw $e; @@ -367,6 +378,7 @@ use {{invokerPackage}}\ObjectSerializer; * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. {{/-first}} {{/servers}} + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -374,9 +386,9 @@ use {{invokerPackage}}\ObjectSerializer; * @deprecated {{/isDeprecated}} */ - public function {{operationId}}Async({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}?int $hostIndex = null, array $variables = []{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + public function {{operationId}}Async({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { - return $this->{{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}$hostIndex, $variables{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + return $this->{{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) ->then( function ($response) { return $response[0]; @@ -428,6 +440,7 @@ use {{invokerPackage}}\ObjectSerializer; * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. {{/-first}} {{/servers}} + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -435,10 +448,10 @@ use {{invokerPackage}}\ObjectSerializer; * @deprecated {{/isDeprecated}} */ - public function {{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}?int $hostIndex = null, array $variables = []{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + public function {{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { $returnType = '{{{returnType}}}'; - $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}$hostIndex, $variables{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); + $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -517,6 +530,7 @@ use {{invokerPackage}}\ObjectSerializer; * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. {{/-first}} {{/servers}} + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -524,7 +538,7 @@ use {{invokerPackage}}\ObjectSerializer; * @deprecated {{/isDeprecated}} */ - public function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}?int $hostIndex = null, array $variables = []{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + public function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { {{#vendorExtensions.x-group-parameters}} // unbox the parameters from the associative array @@ -533,7 +547,9 @@ use {{invokerPackage}}\ObjectSerializer; {{/allParams}}{{#servers.0}} $hostIndex = $associative_array['hostIndex']; $variables = array_key_exists('variables', $associative_array) ? $associative_array['variables'] : []; -{{/servers.0}}{{/vendorExtensions.x-group-parameters}}{{#allParams}} +{{/servers.0}} + $contentType = $associative_array['contentType'] ?? self::contentTypes['{{{operationId}}}'][0]; + {{/vendorExtensions.x-group-parameters}}{{#allParams}} {{#required}} // verify the required parameter '{{paramName}}' is set if (${{paramName}} === null || (is_array(${{paramName}}) && count(${{paramName}}) === 0)) { @@ -578,9 +594,7 @@ use {{invokerPackage}}\ObjectSerializer; throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); } {{/minItems}} - - {{/hasValidation}} - {{/allParams}} + {{/hasValidation}}{{/allParams}} $resourcePath = '{{{path}}}'; $formParams = []; @@ -649,21 +663,17 @@ use {{invokerPackage}}\ObjectSerializer; } {{/formParams}} - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}], - [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}] - ); - } + $headers = $this->headerSelector->selectHeaders( + [{{#produces}}'{{{mediaType}}}', {{/produces}}], + $contentType, + $multipart + ); // for model (json/xml) {{#bodyParams}} if (isset(${{paramName}})) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization(${{paramName}})); } else { $httpBody = ${{paramName}}; @@ -687,9 +697,9 @@ use {{invokerPackage}}\ObjectSerializer; // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); diff --git a/modules/openapi-generator/src/main/resources/python-flask/model.mustache b/modules/openapi-generator/src/main/resources/python-flask/model.mustache index 300938389a1..9be98da6f3f 100644 --- a/modules/openapi-generator/src/main/resources/python-flask/model.mustache +++ b/modules/openapi-generator/src/main/resources/python-flask/model.mustache @@ -58,7 +58,7 @@ class {{classname}}(Model): } {{#vars}}{{#-first}} {{/-first}} - self.{{name}} = {{name}} + self._{{name}} = {{name}} {{/vars}} @classmethod diff --git a/modules/openapi-generator/src/main/resources/python/api_client.handlebars b/modules/openapi-generator/src/main/resources/python/api_client.handlebars index bdcd4519ff4..81426853056 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.handlebars +++ b/modules/openapi-generator/src/main/resources/python/api_client.handlebars @@ -293,7 +293,7 @@ class StyleFormSerializer(ParameterSerializerBase): prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> str: if prefix_separator_iterator is None: - prefix_separator_iterator = PrefixSeparatorIterator('?', '&') + prefix_separator_iterator = PrefixSeparatorIterator('', '&') return self._ref6570_expansion( variable_name=name, in_data=in_data, @@ -1472,7 +1472,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=False) + value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) return dict(body=value) def serialize( diff --git a/modules/openapi-generator/src/main/resources/python/endpoint_args.handlebars b/modules/openapi-generator/src/main/resources/python/endpoint_args.handlebars index bff216a72fb..1eceaf34ad3 100644 --- a/modules/openapi-generator/src/main/resources/python/endpoint_args.handlebars +++ b/modules/openapi-generator/src/main/resources/python/endpoint_args.handlebars @@ -73,6 +73,12 @@ {{/eq}} {{/with}} {{/if}} +{{else}} + {{#if isOverload}} + {{#eq skipDeserialization "True"}} + skip_deserialization: typing_extensions.Literal[True], + {{/eq}} + {{/if}} {{/if}} {{#if queryParams}} query_params: RequestQueryParams = frozendict.frozendict(), diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/new.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/new.handlebars index eb47a54a035..fbf25512bad 100644 --- a/modules/openapi-generator/src/main/resources/python/model_templates/new.handlebars +++ b/modules/openapi-generator/src/main/resources/python/model_templates/new.handlebars @@ -17,7 +17,15 @@ def __new__( {{#if complexType}} {{baseName}}: '{{complexType}}', {{else}} + {{#if getSchemaIsFromAdditionalProperties}} + {{#if addPropsUnset}} + {{baseName}}: typing.Union[schemas.AnyTypeSchema, {{> model_templates/schema_python_types }}], + {{else}} + {{baseName}}: typing.Union[MetaOapg.additional_properties, {{> model_templates/schema_python_types }}], + {{/if}} + {{else}} {{baseName}}: typing.Union[MetaOapg.properties.{{baseName}}, {{> model_templates/schema_python_types }}], + {{/if}} {{/if}} {{/unless}} {{/with}} diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/schema_composed_or_anytype.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/schema_composed_or_anytype.handlebars index 8c7b667493f..7f97830dcf7 100644 --- a/modules/openapi-generator/src/main/resources/python/model_templates/schema_composed_or_anytype.handlebars +++ b/modules/openapi-generator/src/main/resources/python/model_templates/schema_composed_or_anytype.handlebars @@ -68,4 +68,8 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}} {{> model_templates/property_type_hints }} +{{#if additionalProperties}} {{> model_templates/new }} +{{else}} + {{> model_templates/new addPropsUnset=true }} +{{/if}} diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/schema_dict.handlebars b/modules/openapi-generator/src/main/resources/python/model_templates/schema_dict.handlebars index 1bee51b3067..284590644f7 100644 --- a/modules/openapi-generator/src/main/resources/python/model_templates/schema_dict.handlebars +++ b/modules/openapi-generator/src/main/resources/python/model_templates/schema_dict.handlebars @@ -32,4 +32,8 @@ class {{> model_templates/classname }}( {{/if}} {{> model_templates/property_type_hints }} +{{#if additionalProperties}} {{> model_templates/new }} +{{else}} + {{> model_templates/new addPropsUnset=true }} +{{/if}} diff --git a/modules/openapi-generator/src/main/resources/python/rest.handlebars b/modules/openapi-generator/src/main/resources/python/rest.handlebars index b1811396168..2ca16e1639e 100644 --- a/modules/openapi-generator/src/main/resources/python/rest.handlebars +++ b/modules/openapi-generator/src/main/resources/python/rest.handlebars @@ -139,6 +139,7 @@ class RESTClientObject(object): elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 r = self.pool_manager.request( method, url, + body=body, fields=fields, encode_multipart=False, preload_content=not stream, diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index db49260916b..a49694f8a07 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -86,7 +86,7 @@ #' #' library({{{packageName}}}) {{#allParams}} -#' var_{{{paramName}}} <- {{{example}}} # {{{dataType}}} | {{{description}}} +#' var_{{{paramName}}} <- {{{vendorExtensions.x-r-example}}} # {{{dataType}}} | {{{description}}}{{^required}} (Optional){{/required}} {{/allParams}} #' {{#summary}} diff --git a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache index d67e502b01f..451f41a5b42 100644 --- a/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/r/modelGeneric.mustache @@ -60,33 +60,49 @@ } {{/isEnum}} {{#isInteger}} - stopifnot(is.numeric(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.numeric(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be an integer:", `{{name}}`)) + } {{/isInteger}} {{#isLong}} - stopifnot(is.numeric(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.numeric(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be an integer:", `{{name}}`)) + } {{/isLong}} {{#isFloat}} - stopifnot(is.numeric(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.numeric(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a number:", `{{name}}`)) + } {{/isFloat}} {{#isDouble}} - stopifnot(is.numeric(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.numeric(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a number:", `{{name}}`)) + } {{/isDouble}} {{#isString}} - stopifnot(is.character(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.character(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a string:", `{{name}}`)) + } {{/isString}} {{#isBoolean}} - stopifnot(is.logical(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.logical(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a boolean:", `{{name}}`)) + } {{/isBoolean}} {{#isDate}} - stopifnot(is.character(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.character(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a string:", `{{name}}`)) + } {{/isDate}} {{#isDateTime}} - stopifnot(is.character(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.character(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a string:", `{{name}}`)) + } {{/isDateTime}} {{#isUri}} # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(`{{name}}`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", `{{name}}`)) + stop(paste("Error! Invalid data for `{{name}}`. Must be a URL:", `{{name}}`)) } {{/isUri}} {{^isPrimitiveType}} @@ -116,33 +132,49 @@ } {{/isEnum}} {{#isInteger}} - stopifnot(is.numeric(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.numeric(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be an integer:", `{{name}}`)) + } {{/isInteger}} {{#isLong}} - stopifnot(is.numeric(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.numeric(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be an integer:", `{{name}}`)) + } {{/isLong}} {{#isFloat}} - stopifnot(is.numeric(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.numeric(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a number:", `{{name}}`)) + } {{/isFloat}} {{#isDouble}} - stopifnot(is.numeric(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.numeric(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a number:", `{{name}}`)) + } {{/isDouble}} {{#isString}} - stopifnot(is.character(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.character(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a string:", `{{name}}`)) + } {{/isString}} {{#isBoolean}} - stopifnot(is.logical(`{{name}}`), length(`{{name}}`) == 1) + if (!(is.logical(`{{name}}`) && length(`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a boolean:", `{{name}}`)) + } {{/isBoolean}} {{#isDate}} - stopifnot(is.character(`{{name}}`), length(`{{name}}`) == 1) + if (!is.character(`{{name}}`)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a string:", `{{name}}`)) + } {{/isDate}} {{#isDateTime}} - stopifnot(is.character(`{{name}}`), length(`{{name}}`) == 1) + if (!is.character(`{{name}}`)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a string:", `{{name}}`)) + } {{/isDateTime}} {{#isUri}} # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(`{{name}}`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", `{{name}}`)) + stop(paste("Error! Invalid data for `{{name}}`. Must be a URL:", `{{name}}`)) } {{/isUri}} {{^isPrimitiveType}} @@ -251,7 +283,7 @@ {{#isUri}} # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(this_object$`{{baseName}}`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", this_object$`{{baseName}}`)) + stop(paste("Error! Invalid data for `{{baseName}}`. Must be a URL:", this_object$`{{baseName}}`)) } {{/isUri}} self$`{{name}}` <- this_object$`{{baseName}}` @@ -383,7 +415,7 @@ {{#isUri}} # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(this_object$`{{name}}`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", this_object$`{{name}}`)) + stop(paste("Error! Invalid data for `{{name}}`. Must be a URL:", this_object$`{{name}}`)) } {{/isUri}} self$`{{name}}` <- this_object$`{{name}}` @@ -418,33 +450,49 @@ if (!is.null(input_json$`{{name}}`)) { {{^isContainer}} {{#isInteger}} - stopifnot(is.numeric(input_json$`{{name}}`), length(input_json$`{{name}}`) == 1) + if (!(is.numeric(input_json$`{{name}}`) && length(input_json$`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be an integer:", input_json$`{{name}}`)) + } {{/isInteger}} {{#isLong}} - stopifnot(is.numeric(input_json$`{{name}}`), length(input_json$`{{name}}`) == 1) + if (!(is.numeric(input_json$`{{name}}`) && length(input_json$`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be an integer:", input_json$`{{name}}`)) + } {{/isLong}} {{#isFloat}} - stopifnot(is.numeric(input_json$`{{name}}`), length(input_json$`{{name}}`) == 1) + if (!(is.numeric(input_json$`{{name}}`) && length(input_json$`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a number:", input_json$`{{name}}`)) + } {{/isFloat}} {{#isDouble}} - stopifnot(is.numeric(input_json$`{{name}}`), length(input_json$`{{name}}`) == 1) + if (!(is.numeric(input_json$`{{name}}`) && length(input_json$`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a number:", input_json$`{{name}}`)) + } {{/isDouble}} {{#isString}} - stopifnot(is.character(input_json$`{{name}}`), length(input_json$`{{name}}`) == 1) + if (!(is.character(input_json$`{{name}}`) && length(input_json$`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a string:", input_json$`{{name}}`)) + } {{/isString}} {{#isBoolean}} - stopifnot(is.logical(input_json$`{{name}}`), length(input_json$`{{name}}`) == 1) + if (!(is.logical(input_json$`{{name}}`) && length(input_json$`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a boolean:", input_json$`{{name}}`)) + } {{/isBoolean}} {{#isDate}} - stopifnot(is.character(input_json$`{{name}}`), length(input_json$`{{name}}`) == 1) + if (!(is.character(input_json$`{{name}}`) && length(input_json$`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a string:", input_json$`{{name}}`)) + } {{/isDate}} {{#isDateTime}} - stopifnot(is.character(input_json$`{{name}}`), length(input_json$`{{name}}`) == 1) + if (!(is.character(input_json$`{{name}}`) && length(input_json$`{{name}}`) == 1)) { + stop(paste("Error! Invalid data for `{{name}}`. Must be a string:", input_json$`{{name}}`)) + } {{/isDateTime}} {{#isUri}} # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(input_json$`{{name}}`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", input_json$`{{name}}`)) + stop(paste("Error! Invalid data for `{{name}}`. Must be a URL:", input_json$`{{name}}`)) } {{/isUri}} {{^isPrimitiveType}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache index fba4aeda686..57486b46486 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache @@ -1,11 +1,22 @@ [package] name = "{{{packageName}}}" version = "{{{packageVersion}}}" -authors = [{{#infoEmail}}"{{{.}}}"{{/infoEmail}}] +{{#infoEmail}} +authors = ["{{{.}}}"] +{{/infoEmail}} +{{^infoEmail}} +authors = ["OpenAPI Generator team and contributors"] +{{/infoEmail}} {{#appDescription}} description = "{{{.}}}" {{/appDescription}} +{{#licenseInfo}} +license = "{{.}}" +{{/licenseInfo}} +{{^licenseInfo}} +# Override this license by providing a License Object in the OpenAPI. license = "Unlicense" +{{/licenseInfo}} edition = "2018" {{#publishRustRegistry}} publish = ["{{.}}"] @@ -83,7 +94,7 @@ serde_json = "1.0" {{#usesXml}} # TODO: this should be updated to point at the official crate once # https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream -serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master"} +serde-xml-rs = {git = "https://github.com/Metaswitch/serde-xml-rs" , branch = "master"} {{/usesXml}} {{#apiUsesMultipart}} mime_0_2 = { package = "mime", version = "0.2.6", optional = true } diff --git a/modules/openapi-generator/src/main/resources/rust/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust/Cargo.mustache index 9ca82500e3a..98b1024cc0a 100644 --- a/modules/openapi-generator/src/main/resources/rust/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust/Cargo.mustache @@ -1,12 +1,42 @@ [package] name = "{{{packageName}}}" version = "{{#lambdaVersion}}{{{packageVersion}}}{{/lambdaVersion}}" +{{#infoEmail}} +authors = ["{{{.}}}"] +{{/infoEmail}} +{{^infoEmail}} authors = ["OpenAPI Generator team and contributors"] +{{/infoEmail}} +{{#appDescription}} +description = "{{{.}}}" +{{/appDescription}} +{{#licenseInfo}} +license = "{{.}}" +{{/licenseInfo}} +{{^licenseInfo}} +# Override this license by providing a License Object in the OpenAPI. +license = "Unlicense" +{{/licenseInfo}} edition = "2018" +{{#publishRustRegistry}} +publish = ["{{.}}"] +{{/publishRustRegistry}} +{{#repositoryUrl}} +repository = "{{.}}" +{{/repositoryUrl}} +{{#documentationUrl}} +documentation = "{{.}}" +{{/documentationUrl}} +{{#homePageUrl}} +homepage = "{{.}} +{{/homePageUrl}} [dependencies] serde = "^1.0" serde_derive = "^1.0" +{{#serdeWith}} +serde_with = "^2.0" +{{/serdeWith}} serde_json = "^1.0" url = "^2.2" uuid = { version = "^1.0", features = ["serde"] } @@ -14,7 +44,6 @@ uuid = { version = "^1.0", features = ["serde"] } hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" http = "~0.2" -serde_yaml = "0.7" base64 = "~0.7.0" futures = "^0.3" {{/hyper}} @@ -33,8 +62,3 @@ version = "^0.11" features = ["json", "multipart"] {{/supportAsync}} {{/reqwest}} - -[dev-dependencies] -{{#hyper}} -tokio-core = "*" -{{/hyper}} diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index 8e4dac90ce8..2fcad1fbf36 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -70,8 +70,8 @@ pub struct {{{classname}}} { {{#description}} /// {{{.}}} {{/description}} - #[serde(rename = "{{{baseName}}}"{{^required}}, skip_serializing_if = "Option::is_none"{{/required}})] - pub {{{name}}}: {{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{^required}}Option<{{/required}}{{#isEnum}}{{#isArray}}{{#uniqueItems}}std::collections::HashSet<{{/uniqueItems}}{{^uniqueItems}}Vec<{{/uniqueItems}}{{/isArray}}{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{#isModel}}Box<{{{dataType}}}>{{/isModel}}{{^isModel}}{{{dataType}}}{{/isModel}}{{/isEnum}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^required}}>{{/required}}, + #[serde(rename = "{{{baseName}}}"{{^required}}{{#isNullable}}, default, with = "::serde_with::rust::double_option"{{/isNullable}}{{/required}}{{^required}}, skip_serializing_if = "Option::is_none"{{/required}}{{#required}}{{#isNullable}}, deserialize_with = "Option::deserialize"{{/isNullable}}{{/required}})] + pub {{{name}}}: {{#isNullable}}Option<{{/isNullable}}{{^required}}Option<{{/required}}{{#isEnum}}{{#isArray}}{{#uniqueItems}}std::collections::HashSet<{{/uniqueItems}}{{^uniqueItems}}Vec<{{/uniqueItems}}{{/isArray}}{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{#isModel}}Box<{{{dataType}}}>{{/isModel}}{{^isModel}}{{{dataType}}}{{/isModel}}{{/isEnum}}{{#isNullable}}>{{/isNullable}}{{^required}}>{{/required}}, {{/vars}} } 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 d47d980814f..45e2a56434e 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache @@ -141,7 +141,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -215,11 +215,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -257,7 +257,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -328,7 +328,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/crystal/CrystalClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/crystal/CrystalClientCodegenTest.java new file mode 100644 index 00000000000..98f2385d5c5 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/crystal/CrystalClientCodegenTest.java @@ -0,0 +1,146 @@ +/* + * 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.crystal; + +import io.swagger.v3.oas.models.OpenAPI; +import org.apache.commons.io.FileUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.languages.CrystalClientCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.*; + +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; + +/** + * Tests for CrystalClientCodegen-generated templates + */ +public class CrystalClientCodegenTest { + + @Test + public void testGenerateCrystalClientWithHtmlEntity() throws Exception { + final File output = Files.createTempDirectory("test").toFile(); + output.mkdirs(); + output.deleteOnExit(); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/pathWithHtmlEntity.yaml"); + CodegenConfig codegenConfig = new CrystalClientCodegen(); + codegenConfig.setOutputDir(output.getAbsolutePath()); + + ClientOptInput clientOptInput = new ClientOptInput().openAPI(openAPI).config(codegenConfig); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + boolean apiFileGenerated = false; + for (File file : files) { + if (file.getName().equals("default_api.cr")) { + apiFileGenerated = true; + // Crystal client should set the path unescaped in the api file + assertTrue(FileUtils.readFileToString(file, StandardCharsets.UTF_8) + .contains("local_var_path = \"/foo=bar\"")); + } + } + if (!apiFileGenerated) { + fail("Default api file is not generated!"); + } + } + + @Test + public void testInitialConfigValues() throws Exception { + final CrystalClientCodegen codegen = new CrystalClientCodegen(); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), + Boolean.TRUE); + Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); + Assert.assertEquals(codegen.modelPackage(), "models"); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), null); + Assert.assertEquals(codegen.apiPackage(), "api"); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), null); + } + + @Test + public void testSettersForConfigValues() throws Exception { + final CrystalClientCodegen codegen = new CrystalClientCodegen(); + codegen.setHideGenerationTimestamp(false); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), + Boolean.FALSE); + Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + } + + @Test + public void testAdditionalPropertiesPutForConfigValues() throws Exception { + final CrystalClientCodegen codegen = new CrystalClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); + codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "crystal-models"); + codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "crystal-api"); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), + Boolean.FALSE); + Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "crystal-models"); + Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "crystal-api"); + } + + @Test + public void testBooleanDefaultValue() throws Exception { + final File output = Files.createTempDirectory("test").toFile(); + output.mkdirs(); + output.deleteOnExit(); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/npe1.yaml"); + CodegenConfig codegenConfig = new CrystalClientCodegen(); + codegenConfig.setOutputDir(output.getAbsolutePath()); + + ClientOptInput clientOptInput = new ClientOptInput().openAPI(openAPI).config(codegenConfig); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + boolean apiFileGenerated = false; + for (File file : files) { + if (file.getName().equals("default_api.cr")) { + apiFileGenerated = true; + // Crystal client should set the path unescaped in the api file + assertTrue(FileUtils.readFileToString(file, StandardCharsets.UTF_8) + .contains("local_var_path = \"/default/Resources/{id}\"")); + } + } + if (!apiFileGenerated) { + fail("Default api file is not generated!"); + } + } + + @Test + public void testSanitizeModelName() throws Exception { + final CrystalClientCodegen codegen = new CrystalClientCodegen(); + codegen.setHideGenerationTimestamp(false); + codegen.processOpts(); + + Assert.assertEquals(codegen.sanitizeModelName("JSON::Any"), "JSON::Any"); + // Disallows single colons + Assert.assertEquals(codegen.sanitizeModelName("JSON:Any"), "JSONAny"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java index 894a105fb45..b55967fdaf9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java @@ -222,4 +222,22 @@ public class GoClientCodegenTest { "func Test_openapi_PetApiService(t *testing.T) {"); } + @Test + public void verifyFormatErrorMessageInUse() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("go") + .setInputSpec("src/test/resources/3_0/go/petstore-with-problem-details.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + TestUtils.assertFileExists(Paths.get(output + "/api_pet.go")); + TestUtils.assertFileContains(Paths.get(output + "/api_pet.go"), + "newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)"); + } } 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 11956bdec17..a63f5be4276 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 @@ -103,7 +103,7 @@ public class AbstractJavaCodegenTest { } @Test - public void convertVarName() throws Exception { + public void convertVarName() { Assert.assertEquals(fakeJavaCodegen.toVarName("name"), "name"); Assert.assertEquals(fakeJavaCodegen.toVarName("$name"), "$name"); Assert.assertEquals(fakeJavaCodegen.toVarName("nam$$e"), "nam$$e"); @@ -119,10 +119,15 @@ public class AbstractJavaCodegenTest { Assert.assertEquals(fakeJavaCodegen.toVarName("1A"), "_1A"); Assert.assertEquals(fakeJavaCodegen.toVarName("1AAAA"), "_1AAAA"); Assert.assertEquals(fakeJavaCodegen.toVarName("1AAaa"), "_1aAaa"); + + AbstractJavaCodegen withCaml = new P_AbstractJavaCodegen(); + withCaml.setCamelCaseDollarSign(true); + Assert.assertEquals(withCaml.toVarName("$name"), "$Name"); + Assert.assertEquals(withCaml.toVarName("1AAaa"), "_1AAaa"); } @Test - public void convertModelName() throws Exception { + public void convertModelName() { Assert.assertEquals(fakeJavaCodegen.toModelName("name"), "Name"); Assert.assertEquals(fakeJavaCodegen.toModelName("$name"), "Name"); Assert.assertEquals(fakeJavaCodegen.toModelName("nam#e"), "Name"); 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 e4b4fc94da6..81bdccd09a6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -17,10 +17,41 @@ package org.openapitools.codegen.java; -import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; +import com.google.common.collect.ImmutableMap; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.ComposedSchema; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.IntegerSchema; +import io.swagger.v3.oas.models.media.MediaType; +import io.swagger.v3.oas.models.media.ObjectSchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.parser.util.SchemaTypeUtil; +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.CodegenResponse; +import org.openapitools.codegen.CodegenSecurity; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.java.assertions.JavaFileAssert; +import org.openapitools.codegen.languages.AbstractJavaCodegen; +import org.openapitools.codegen.languages.JavaClientCodegen; +import org.openapitools.codegen.languages.features.BeanValidationFeatures; +import org.openapitools.codegen.languages.features.CXFServerFeatures; +import org.openapitools.codegen.model.OperationMap; +import org.openapitools.codegen.model.OperationsMap; +import org.testng.Assert; +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; import java.io.File; import java.io.IOException; @@ -44,42 +75,10 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -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.CodegenResponse; -import org.openapitools.codegen.CodegenSecurity; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.config.CodegenConfigurator; -import org.openapitools.codegen.java.assertions.JavaFileAssert; -import org.openapitools.codegen.languages.AbstractJavaCodegen; -import org.openapitools.codegen.languages.JavaClientCodegen; -import org.openapitools.codegen.languages.features.BeanValidationFeatures; -import org.openapitools.codegen.languages.features.CXFServerFeatures; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; -import org.testng.Assert; -import org.testng.annotations.Ignore; -import org.testng.annotations.Test; - -import com.google.common.collect.ImmutableMap; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.ComposedSchema; -import io.swagger.v3.oas.models.media.Content; -import io.swagger.v3.oas.models.media.IntegerSchema; -import io.swagger.v3.oas.models.media.MediaType; -import io.swagger.v3.oas.models.media.ObjectSchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.StringSchema; -import io.swagger.v3.oas.models.parameters.RequestBody; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.parser.util.SchemaTypeUtil; +import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; public class JavaClientCodegenTest { @@ -951,7 +950,7 @@ public class JavaClientCodegenTest { * * 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. + * how we can fix it accordingly. */ @Test @Ignore @@ -1231,7 +1230,7 @@ public class JavaClientCodegenTest { final Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); TestUtils.assertFileContains(defaultApi, "value instanceof Map"); } - + /** * See https://github.com/OpenAPITools/openapi-generator/issues/8352 */ @@ -1665,4 +1664,28 @@ public class JavaClientCodegenTest { .assertParameterAnnotations() .containsWithName("NotNull"); } + + @Test + public void testNativeClientExplodedQueryParamWithArrayProperty() throws IOException { + Map properties = new HashMap<>(); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.NATIVE) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/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()));" + ); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java index d55c062f7e7..f3cc4a4c490 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java @@ -205,3 +205,6 @@ public class JavaHelidonCommonCodegenPackagePrefixTest { } } + + + diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java index 967e77bcbaf..ca7bf989b1b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java @@ -16,6 +16,7 @@ */ package org.openapitools.codegen.java.helidon.functional; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import java.nio.file.Files; @@ -26,6 +27,12 @@ import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; public class FunctionalHelidonClientBase extends FunctionalBase { + + @BeforeClass + public void setup() { + generatorName("java-helidon-client"); + } + @Test void buildPetstore() { generate("src/test/resources/3_0/petstore.yaml"); 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 ac1f12a3eb0..bec4ee24ce1 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 @@ -18,8 +18,11 @@ 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.INTERFACE_ONLY; +import static org.openapitools.codegen.languages.SpringCodegen.REQUEST_MAPPING_OPTION; import static org.openapitools.codegen.languages.SpringCodegen.RESPONSE_WRAPPER; import static org.openapitools.codegen.languages.SpringCodegen.SPRING_BOOT; import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; @@ -43,7 +46,6 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; -import org.assertj.core.api.Assertions; import org.openapitools.codegen.java.assertions.JavaFileAssert; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.ClientOptInput; @@ -106,10 +108,9 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java")) .assertTypeAnnotations() - .hasSize(4) + .hasSize(3) .containsWithName("Validated") .containsWithName("Generated") - .containsWithName("RequestMapping") .containsWithNameAndAttributes("Generated", ImmutableMap.of( "value", "\"org.openapitools.codegen.languages.SpringCodegen\"" )) @@ -660,6 +661,7 @@ public class SpringCodegenTest { public void testRequestMappingAnnotation() throws IOException { final SpringCodegen codegen = new SpringCodegen(); codegen.setLibrary("spring-boot"); + codegen.additionalProperties().put(REQUEST_MAPPING_OPTION, SpringCodegen.RequestMappingMode.api_interface); final Map files = generateFiles(codegen, "src/test/resources/2_0/petstore.yaml"); @@ -673,7 +675,7 @@ public class SpringCodegenTest { } @Test - public void testNoRequestMappingAnnotation() throws IOException { + public void testNoRequestMappingAnnotation_spring_cloud_default() throws IOException { final SpringCodegen codegen = new SpringCodegen(); codegen.setLibrary( "spring-cloud" ); @@ -686,6 +688,21 @@ public class SpringCodegenTest { } + @Test + public void testNoRequestMappingAnnotation() throws IOException { + final SpringCodegen codegen = new SpringCodegen(); + codegen.setLibrary( "spring-cloud" ); + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); + codegen.additionalProperties().put(REQUEST_MAPPING_OPTION, SpringCodegen.RequestMappingMode.none); + + final Map files = generateFiles( codegen, "src/test/resources/2_0/petstore.yaml" ); + + // Check that the @RequestMapping annotation is not generated in the Api file + final File petApiFile = files.get( "PetApi.java" ); + JavaFileAssert.assertThat( petApiFile ).assertTypeAnnotations().hasSize( 3 ).containsWithName( "Validated" ) + .containsWithName( "Generated" ).containsWithName( "Tag" ); + } + @Test public void testSettersForConfigValues() throws Exception { final SpringCodegen codegen = new SpringCodegen(); @@ -1214,7 +1231,7 @@ public class SpringCodegenTest { generator.opts(input).generate(); File[] generatedModels = new File(outputPath + "/src/main/java/org/openapitools/model").listFiles(); - Assertions.assertThat(generatedModels).isNotEmpty(); + assertThat(generatedModels).isNotEmpty(); for (File modelPath : generatedModels) { JavaFileAssert.assertThat(modelPath) @@ -1227,22 +1244,9 @@ public class SpringCodegenTest { @Test public void testHandleDefaultValue_issue8535() throws Exception { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/3_0/issue_8535.yaml", null, new ParseOptions()).getOpenAPI(); - SpringCodegen codegen = new SpringCodegen(); - codegen.setOutputDir(output.getAbsolutePath()); - codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); - - ClientOptInput input = new ClientOptInput() - .openAPI(openAPI) - .config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); - Map files = generator.opts(input).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + Map additionalProperties = new HashMap<>(); + additionalProperties.put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + Map files = generateFromContract("src/test/resources/3_0/issue_8535.yaml", SPRING_BOOT, additionalProperties); JavaFileAssert.assertThat(files.get("TestHeadersApi.java")) .assertMethod("headersTest") @@ -1329,29 +1333,15 @@ public class SpringCodegenTest { @Test public void testResponseWithArray_issue11897() throws Exception { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_11897.yaml", null, new ParseOptions()).getOpenAPI(); - SpringCodegen codegen = new SpringCodegen(); - codegen.setLibrary(SPRING_BOOT); - codegen.setOutputDir(output.getAbsolutePath()); - codegen.additionalProperties().put(AbstractJavaCodegen.FULL_JAVA_UTIL, "true"); - codegen.additionalProperties().put(SpringCodegen.USE_TAGS, "true"); - codegen.additionalProperties().put(SpringCodegen.INTERFACE_ONLY, "true"); - codegen.additionalProperties().put(SpringCodegen.SKIP_DEFAULT_INTERFACE, "true"); - codegen.additionalProperties().put(SpringCodegen.PERFORM_BEANVALIDATION, "true"); - codegen.additionalProperties().put(SpringCodegen.SPRING_CONTROLLER, "true"); - codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "jackson"); - - 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())); + 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"); + Map files = generateFromContract("src/test/resources/bugs/issue_11897.yaml", SPRING_BOOT, additionalProperties); JavaFileAssert.assertThat(files.get("MetadataApi.java")) .assertMethod("getWithArrayOfObjects").hasReturnType("ResponseEntity>") @@ -1369,29 +1359,16 @@ public class SpringCodegenTest { @Test public void shouldSetDefaultValueForMultipleArrayItems() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); + 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"); - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_11957.yaml", null, new ParseOptions()).getOpenAPI(); - SpringCodegen codegen = new SpringCodegen(); - codegen.setLibrary(SPRING_BOOT); - codegen.setOutputDir(output.getAbsolutePath()); - codegen.additionalProperties().put(AbstractJavaCodegen.FULL_JAVA_UTIL, "true"); - codegen.additionalProperties().put(SpringCodegen.USE_TAGS, "true"); - codegen.additionalProperties().put(SpringCodegen.INTERFACE_ONLY, "true"); - codegen.additionalProperties().put(SpringCodegen.SKIP_DEFAULT_INTERFACE, "true"); - codegen.additionalProperties().put(SpringCodegen.PERFORM_BEANVALIDATION, "true"); - codegen.additionalProperties().put(SpringCodegen.SPRING_CONTROLLER, "true"); - codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "jackson"); - - 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())); + Map files = generateFromContract("src/test/resources/bugs/issue_11957.yaml", SPRING_BOOT, additionalProperties); JavaFileAssert.assertThat(files.get("SearchApi.java")) .assertMethod("defaultList") @@ -1417,21 +1394,7 @@ public class SpringCodegenTest { @Test public void testPutItemsMethodContainsKeyInSuperClassMethodCall_issue12494() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_12494.yaml", null, new ParseOptions()).getOpenAPI(); - SpringCodegen codegen = new SpringCodegen(); - 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())); + Map files = generateFromContract("src/test/resources/bugs/issue_12494.yaml", null); JavaFileAssert.assertThat(files.get("ChildClass.java")) .assertMethod("putSomeMapItem") @@ -1440,22 +1403,7 @@ public class SpringCodegenTest { @Test public void shouldHandleCustomResponseType_issue11731() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_11731.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())); + Map files = generateFromContract("src/test/resources/bugs/issue_11731.yaml", SPRING_BOOT); JavaFileAssert.assertThat(files.get("CustomersApi.java")) .assertMethod("getAllUsingGET1") @@ -1464,23 +1412,9 @@ public class SpringCodegenTest { @Test public void shouldHandleContentTypeWithSecondWildcardSubtype_issue12457() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_12457.yaml", null, new ParseOptions()).getOpenAPI(); - SpringCodegen codegen = new SpringCodegen(); - codegen.setLibrary(SPRING_BOOT); - codegen.setOutputDir(output.getAbsolutePath()); - codegen.additionalProperties().put(SpringCodegen.USE_TAGS, "true"); - - 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())); + Map additionalProperties = new HashMap<>(); + additionalProperties.put(SpringCodegen.USE_TAGS, "true"); + Map files = generateFromContract("src/test/resources/bugs/issue_12457.yaml", SPRING_BOOT, additionalProperties); JavaFileAssert.assertThat(files.get("UsersApi.java")) .assertMethod("wildcardSubTypeForContentType") @@ -1493,28 +1427,15 @@ public class SpringCodegenTest { @Test public void shouldGenerateDiscriminatorFromAllOfWhenUsingLegacyDiscriminatorBehaviour_issue12692() throws IOException { - File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); - output.deleteOnExit(); - - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/bugs/issue_12692.yml", null, new ParseOptions()).getOpenAPI(); - SpringCodegen codegen = new SpringCodegen(); - codegen.setLibrary(SPRING_BOOT); - codegen.setOutputDir(output.getAbsolutePath()); - codegen.additionalProperties().put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true"); - - ClientOptInput input = new ClientOptInput() - .openAPI(openAPI) - .config(codegen); - - DefaultGenerator generator = new DefaultGenerator(); - generator.opts(input).generate(); + Map additionalProperties = new HashMap<>(); + additionalProperties.put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true"); + Map output = generateFromContract("src/test/resources/bugs/issue_12692.yml", SPRING_BOOT, additionalProperties); String jsonTypeInfo = "@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = \"type\", visible = true)"; String jsonSubType = "@JsonSubTypes({\n" + " @JsonSubTypes.Type(value = Cat.class, name = \"cat\")" + "})"; - assertFileContains(Paths.get(output.getAbsolutePath() + "/src/main/java/org/openapitools/model/Pet.java"), jsonTypeInfo, jsonSubType); + assertFileContains(output.get("Pet.java").toPath(), jsonTypeInfo, jsonSubType); } @Test @@ -1696,4 +1617,46 @@ public class SpringCodegenTest { .assertMethod("equals") .bodyContainsLines("return Arrays.equals(this.picture, testObject.picture);"); } + + @Test + public void contractWithoutEnumDoesNotContainsEnumConverter() throws IOException { + Map output = generateFromContract("src/test/resources/3_0/generic.yaml", SPRING_BOOT); + + assertThat(output).doesNotContainKey("EnumConverterConfiguration.java"); + } + + @Test + public void contractWithEnumContainsEnumConverter() throws IOException { + Map output = generateFromContract("src/test/resources/3_0/enum.yaml", SPRING_BOOT); + + JavaFileAssert.assertThat(output.get("EnumConverterConfiguration.java")) + .assertMethod("typeConverter"); + } + + private Map generateFromContract(String url, String library) throws IOException { + return generateFromContract(url, library, new HashMap<>()); + } + private Map generateFromContract(String url, String library, Map additionalProperties) throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation(url, null, new ParseOptions()).getOpenAPI(); + + SpringCodegen codegen = new SpringCodegen(); + if (null != library) { + codegen.setLibrary(library); + } + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().putAll(additionalProperties); + + ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + return generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java index bd06fde5f2a..0d12b103ea4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java @@ -66,7 +66,7 @@ public class KotlinReservedWordsTest { final DefaultCodegen codegen = new KotlinClientCodegen(); final Schema schema = new Schema(); final String escaped = "`" + reservedWord + "`"; - final String titleCased = StringUtils.camelize(reservedWord, false); + final String titleCased = StringUtils.camelize(reservedWord); codegen.setOpenAPI(openAPI); CodegenModel model = codegen.fromModel(reservedWord, schema); @@ -106,7 +106,7 @@ public class KotlinReservedWordsTest { final DefaultCodegen codegen = new KotlinClientCodegen(); final String escaped = "`" + reservedWord + "`"; - final String titleCased = StringUtils.camelize(reservedWord, false); + final String titleCased = StringUtils.camelize(reservedWord); Schema linked = openAPI.getComponents().getSchemas().get("Linked"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java index 2b3f632e9dd..d4c94d47026 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java @@ -15,6 +15,24 @@ public class TitlecaseLambdaTest extends LambdaTest { test("Once Upon A Time", "{{#titlecase}}once upon a time{{/titlecase}}", ctx); } + @Test + public void titlecaseSingleLetterTest() { + // Given + Map ctx = context("titlecase", new TitlecaseLambda()); + + // When & Then + test("O", "{{#titlecase}}o{{/titlecase}}", ctx); + } + + @Test + public void titlecaseEmptyStringTest() { + // Given + Map ctx = context("titlecase", new TitlecaseLambda()); + + // When & Then + test("", "{{#titlecase}}{{/titlecase}}", ctx); + } + @Test public void titlecaseWithDelimiterTest() { // Given diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java index 2001a9844c5..f8a0d6ddf99 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java @@ -3,6 +3,8 @@ package org.openapitools.codegen.utils; import org.testng.Assert; import org.testng.annotations.Test; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_CHAR; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.StringUtils.*; public class StringUtilsTest { @@ -21,14 +23,18 @@ public class StringUtilsTest { Assert.assertEquals(camelize("some_value"), "SomeValue"); Assert.assertEquals(camelize("$type"), "$Type"); - Assert.assertEquals(camelize("abcd", true), "abcd"); - Assert.assertEquals(camelize("some-value", true), "someValue"); - Assert.assertEquals(camelize("some_value", true), "someValue"); - Assert.assertEquals(camelize("Abcd", true), "abcd"); - Assert.assertEquals(camelize("$type", true), "$type"); + Assert.assertEquals(camelize("abcd", LOWERCASE_FIRST_LETTER), "abcd"); + Assert.assertEquals(camelize("some-value", LOWERCASE_FIRST_LETTER), "someValue"); + Assert.assertEquals(camelize("some_value", LOWERCASE_FIRST_LETTER), "someValue"); + Assert.assertEquals(camelize("Abcd", LOWERCASE_FIRST_LETTER), "abcd"); + Assert.assertEquals(camelize("$type", LOWERCASE_FIRST_LETTER), "$type"); - Assert.assertEquals(camelize("123", true), "123"); - Assert.assertEquals(camelize("$123", true), "$123"); + Assert.assertEquals(camelize("123", LOWERCASE_FIRST_LETTER), "123"); + Assert.assertEquals(camelize("$123", LOWERCASE_FIRST_LETTER), "$123"); + + + Assert.assertEquals(camelize("some-value", LOWERCASE_FIRST_CHAR), "someValue"); + Assert.assertEquals(camelize("$type", LOWERCASE_FIRST_CHAR), "$Type"); } @Test diff --git a/modules/openapi-generator/src/test/resources/3_0/csharp-netcore/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/csharp-netcore/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml new file mode 100644 index 00000000000..afd5a8a62b7 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/csharp-netcore/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -0,0 +1,2188 @@ +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' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '405': + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + 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' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatusWithFilter: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatusWithFilter + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + schema: + type: array + items: + $ref: '#/components/schemas/PetStatusFilter' + 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: + - http_signature_test: [] + - 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 + 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: + - http_signature_test: [] + - 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 + 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: + - http_signature_test: [] + - 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 + 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/{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 generated 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 + responses: + default: + description: successful operation + 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 + 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 + 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 + - 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 + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + 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 + /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 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/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 + responses: + '400': + description: Invalid request + '404': + description: Not found + 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' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + 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 + default: '2010-02-01T10:20:10.11111+01:00' + example: '2020-02-02T20:20:20.22222Z' + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + 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: Someting wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /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' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/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 + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /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: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - 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 + 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 + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/array-of-enums: + get: + tags: + - fake + summary: Array of Enums + operationId: getArrayOfEnums + responses: + 200: + description: Got named array of enums + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' +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: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + examples: + simple-list: + summary: Simple list example + description: Should not get into code examples + value: + - username: foo + - username: bar + 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 + 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' + Bar: + type: string + default: bar + 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 + example: '2020-02-02T20:20:20.000222Z' + 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 + objectWithNoDeclaredProps: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for objects + Value must be a map of strings to values. It cannot be the 'null' value. + objectWithNoDeclaredPropsNullable: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for nullable objects. + Value must be a map of strings to values or the 'null' value. + nullable: true + 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 + # TODO: this should be supported, currently there are some issues in the code generation. + #anyTypeExceptNullProp: + # description: any type except 'null' + # Here the 'type' attribute is not specified, which means the value can be anything, + # including the null value, string, number, boolean, array or object. + # not: + # type: 'null' + 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 + 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 + 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 + 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' + - $ref: '#/components/schemas/Address' + - type: object + properties: + declawed: + type: boolean + Address: + type: object + additionalProperties: + type: integer + 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 + multipleOf: 2 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + 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' + 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_integer_only: + type: integer + enum: + - 2 + - -2 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + type: object + properties: {} + map_with_undeclared_properties_anytype_3: + type: object + additionalProperties: true + empty_map: + type: object + description: an object with no declared properties and no undeclared + properties, hence it's an empty map. + additionalProperties: false + map_with_undeclared_properties_string: + type: object + additionalProperties: + type: string + 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: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + 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 + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + '_special_model.name_': + type: string + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + fruit: + properties: + color: + type: string + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + # Below additionalProperties is set to false to validate the use + # case when a composed schema has additionalProperties set to false. + additionalProperties: false + apple: + type: object + properties: + cultivar: + type: string + pattern: ^[a-zA-Z\s]*$ + origin: + type: string + pattern: /^[A-Z\s]*$/i + nullable: true + banana: + type: object + properties: + lengthCm: + type: number + mammal: + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className + whale: + type: object + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + zebra: + type: object + properties: + type: + type: string + enum: + - plains + - mountain + - grevys + className: + type: string + required: + - className + additionalProperties: true + Pig: + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + discriminator: + propertyName: className + BasquePig: + type: object + properties: + className: + type: string + required: + - className + DanishPig: + type: object + properties: + className: + type: string + required: + - className + gmFruit: + properties: + color: + type: string + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + additionalProperties: false + fruitReq: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + additionalProperties: false + appleReq: + type: object + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + additionalProperties: false + bananaReq: + type: object + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + additionalProperties: false + # go-experimental is unable to make Triangle and Quadrilateral models + # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + Drawing: + type: object + properties: + mainShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value cannot be null. + $ref: '#/components/schemas/Shape' + shapeOrNull: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because ShapeOrNull has 'null' + # type as a child schema of 'oneOf'. + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because NullableShape has the + # 'nullable: true' attribute. For this specific scenario this is exactly the + # same thing as 'shapeOrNull'. + $ref: '#/components/schemas/NullableShape' + shapes: + type: array + items: + $ref: '#/components/schemas/Shape' + additionalProperties: + # Here the additional properties are specified using a referenced schema. + # This is just to validate the generated code works when using $ref + # under 'additionalProperties'. + $ref: '#/components/schemas/fruit' + Shape: + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + ShapeOrNull: + description: The value may be a shape or the 'null' value. + This is introduced in OAS schema >= 3.1. + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + 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. + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + nullable: true + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + discriminator: + propertyName: triangleType + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + additionalProperties: false + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + discriminator: + propertyName: quadrilateralType + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + type: object + required: + - pet_type + properties: + pet_type: + type: string + discriminator: + propertyName: pet_type + ParentPet: + type: object + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - type: object + properties: + name: + type: string + pet_type: + x-enum-as-string: true + type: string + enum: + - ChildCat + default: ChildCat + ArrayOfEnums: + type: array + items: + $ref: '#/components/schemas/OuterEnum' + DateTimeTest: + type: string + default: '2010-01-01T10:10:10.000111+01:00' + example: '2010-01-01T10:10:10.000111+01:00' + format: date-time + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' + PetStatusFilter: + type: string + enum: + - available + - pending + - sold \ No newline at end of file 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 b9e2888f551..7695348b208 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 @@ -2160,3 +2160,22 @@ components: StringArrayItem: type: string format: string + Activity: + description: "test map of maps" + type: object + properties: + activity_outputs: + type: object + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + ActivityOutputRepresentation: + type: array + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + ActivityOutputElementRepresentation: + type: object + properties: + prop1: + type: string + prop2: + type: object diff --git a/modules/openapi-generator/src/test/resources/3_0/enum.yaml b/modules/openapi-generator/src/test/resources/3_0/enum.yaml new file mode 100644 index 00000000000..e0cb0f881a8 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/enum.yaml @@ -0,0 +1,32 @@ +openapi: 3.0.0 +info: + title: Sample API + description: API description in Markdown. + version: 1.0.0 +paths: + /ponies: + get: + summary: Returns all animals. + description: Optional extended description in Markdown. + responses: + 200: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pony' +components: + schemas: + Pony: + type: object + properties: + type: + $ref: '#/components/schemas/Type' + Type: + type: string + enum: + - Earth + - Pegasi + - Unicorn \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/exploded-query-param-array.yaml b/modules/openapi-generator/src/test/resources/3_0/exploded-query-param-array.yaml new file mode 100644 index 00000000000..a46d6b753e0 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/exploded-query-param-array.yaml @@ -0,0 +1,41 @@ +openapi: 3.0.3 +info: + title: Exploded query param array + description: "Exploded query params" + version: "1.0.0" +servers: + - url: localhost:8080 +paths: + /api: + get: + operationId: GetSomeValue + parameters: + - in: query + name: QueryObject + explode: true + style: form + schema: + type: object + properties: + values: + type: array + items: + type: string + responses: + '200': + description: Some return value + content: + application/json: + schema: + $ref: '#/components/schemas/SomeReturnValue' + example: + someValue: value +components: + schemas: + SomeReturnValue: + type: object + required: + - someValue + properties: + someValue: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 7b11b81e32a..4c7ed5960e1 100644 --- a/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -2023,3 +2023,8 @@ components: additionalProperties: type: string format: binary + OneOfPrimitiveTypes: + oneOf: + - type: string + - format: date-time + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-problem-details.yaml b/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-problem-details.yaml new file mode 100644 index 00000000000..c4385355570 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/go/petstore-with-problem-details.yaml @@ -0,0 +1,61 @@ +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 +paths: + /foo: + get: + tags: + - pet + responses: + "200": + description: response + content: + application/json: + schema: + $ref: '#/components/schemas/Foo' + "404": + description: not found + content: + application/json: + schema: + $ref: '#/components/schemas/RestServiceError' + "422": + description: validation error + content: + application/json: + schema: + $ref: '#/components/schemas/RestServiceError' +components: + schemas: + Foo: + type: string + default: foo + # RFC7807 Problem Detail + RestServiceError: + properties: + type: + description: " A URI reference that identifies the problem type" + type: string + title: + description: "A short, human-readable summary of the problem type." + type: string + status: + description: "The HTTP Status Code" + type: integer + detail: + description: "A human-readable explanation specific to this occurrence of the problem." + type: string + instance: + description: "A unique URI that identifies the specific occurrence of the problem." + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml index 7384758e953..4219f4004a2 100644 --- a/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml @@ -72,7 +72,10 @@ paths: - 'write:pets' - 'read:pets' requestBody: - $ref: '#/components/schemas/Pet' + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' /pet/findByStatus: get: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml index bcf99067930..3a10351b615 100644 --- a/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml @@ -72,7 +72,10 @@ paths: - 'write:pets' - 'read:pets' requestBody: - $ref: '#/components/schemas/Pet' + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' /pet/findByStatus: get: tags: diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml index a21b6b4e0d0..daf9e82cf1d 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml @@ -36,13 +36,13 @@ paths: - name: header1 in: header schema: - $ref: '#/components/requestBodies/Pet' + $ref: '#/components/schemas/Pet' - name: header2 in: header schema: type: array items: - $ref: '#/components/requestBodies/Pet' + $ref: '#/components/schemas/Pet' - name: Accept in: header schema: diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index deef554542d..f6c3f327b18 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -2978,4 +2978,17 @@ components: $ref: "#/components/schemas/ArrayWithValidationsInItems" required: - from - - "!reference" \ No newline at end of file + - "!reference" + ObjectWithOptionalTestProp: + type: object + properties: + test: + type: string + ObjectWithAllOfWithReqTestPropFromUnsetAddProp: + allOf: + - $ref: '#/components/schemas/ObjectWithOptionalTestProp' + - type: object + required: [ test ] + properties: + name: + type: string \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml index 55bedd6d474..86ef6839356 100644 --- a/modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml @@ -1121,3 +1121,71 @@ components: required: - className - url_property + 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 + default: 2019-07-19 + dateTime: + type: string + format: date-time + default: 2015-10-28T14:38:02Z + 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/3_0/rust/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml index deaf6dd0860..0c09dee9414 100644 --- a/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml @@ -858,4 +858,23 @@ components: async: type: boolean super: - type: boolean \ No newline at end of file + type: boolean + OptionalTesting: + description: Test handling of optional and nullable fields + type: object + required: + - required_nonnull + - required_nullable + properties: + optional_nonnull: + type: string + nullable: false + required_nonnull: + type: string + nullable: false + optional_nullable: + type: string + nullable: true + required_nullable: + type: string + nullable: true \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/typescript-axios/with-separate-models-and-api-inheritance.yaml b/modules/openapi-generator/src/test/resources/3_0/typescript-axios/with-separate-models-and-api-inheritance.yaml index d784ef25ba5..55262b783a3 100644 --- a/modules/openapi-generator/src/test/resources/3_0/typescript-axios/with-separate-models-and-api-inheritance.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/typescript-axios/with-separate-models-and-api-inheritance.yaml @@ -33,3 +33,63 @@ components: type: object allOf: - "$ref": "#/components/schemas/AbstractUserDto" + AbstractFlatStockPickOrderBaseDto: + required: + - externalDmsCustomerOrderId + - id + - partInformation + - pickedQuantity + - quantity + - type + - warehouseId + type: object + properties: + id: + type: integer + format: int64 + created: + type: string + format: date-time + lastModified: + type: string + format: date-time + warehouseId: + type: integer + format: int64 + quantity: + type: number + stockLocation: + maxLength: 31 + minLength: 0 + type: string + barcode: + maxLength: 31 + minLength: 1 + type: string + pickedQuantity: + type: number + type: + type: string + discriminator: + propertyName: type + mapping: + STOCK_PICK_ORDER: '#/components/schemas/FlatStockPickOrderDto' + FlatStockPickOrderDto: + required: + - externalDmsCustomerOrderId + - id + - partInformation + - pickedQuantity + - quantity + - warehouseId + type: object + allOf: + - $ref: '#/components/schemas/AbstractFlatStockPickOrderBaseDto' + - type: object + properties: + blockedUntil: + type: string + format: date-time + blockedById: + type: integer + format: int64 diff --git a/pom.xml b/pom.xml index 9990cddbc7a..09f7a3db8c8 100644 --- a/pom.xml +++ b/pom.xml @@ -1333,10 +1333,8 @@ samples/client/petstore/go samples/openapi3/client/petstore/go - samples/server/petstore/go-api-server - samples/server/petstore/go-echo-server @@ -1490,7 +1488,7 @@ 1.4 2.11.0 3.12.0 - 1.9 + 1.10.0 1.3.0 1.0.2 4.9.10 @@ -1498,6 +1496,7 @@ 30.1.1-jre 4.2.1 2.10.0 + 2.13.4.2 2.13.4 0.8.7 1.14 @@ -1519,7 +1518,7 @@ 3.0.0-M6 7.22.0 io.swagger.parser.v3 - 2.1.1 + 2.1.6 7.5 1.34 3.4.3 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 3760fe4455b..29a02766057 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 @@ -13,6 +13,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; @@ -116,6 +117,8 @@ namespace Org.OpenAPITools.Client return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } @@ -214,5 +217,40 @@ namespace Org.OpenAPITools.Client 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/others/java/okhttp-gson-streaming/build.gradle b/samples/client/others/java/okhttp-gson-streaming/build.gradle index 16f1394bf96..ad54274be84 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.gradle +++ b/samples/client/others/java/okhttp-gson-streaming/build.gradle @@ -13,7 +13,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -65,7 +65,7 @@ if(hasProperty('target') && target == 'android') { task.from variant.javaCompile.destinationDir task.destinationDir = project.file("${project.buildDir}/outputs/jar") task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + artifacts.add('archives', task) } } @@ -106,20 +106,20 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.6.5' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.3' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3' - implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.8.5' implementation 'javax.ws.rs:jsr311-api:1.1.1' implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' - implementation 'org.openapitools:jackson-databind-nullable:0.2.3' + implementation 'org.openapitools:jackson-databind-nullable:0.2.4' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' } javadoc { diff --git a/samples/client/others/java/okhttp-gson-streaming/build.sbt b/samples/client/others/java/okhttp-gson-streaming/build.sbt index 141ae383b38..544922ffed0 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.sbt +++ b/samples/client/others/java/okhttp-gson-streaming/build.sbt @@ -10,18 +10,19 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.6.5", - "com.squareup.okhttp3" % "okhttp" % "4.9.3", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.3", - "com.google.code.gson" % "gson" % "2.9.0", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", "org.apache.commons" % "commons-lang3" % "3.12.0", "javax.ws.rs" % "jsr311-api" % "1.1.1", "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" ) ) diff --git a/samples/client/others/java/okhttp-gson-streaming/pom.xml b/samples/client/others/java/okhttp-gson-streaming/pom.xml index a9fb0ce7a3a..bdfd7504024 100644 --- a/samples/client/others/java/okhttp-gson-streaming/pom.xml +++ b/samples/client/others/java/okhttp-gson-streaming/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.1.0 enforce-maven @@ -93,6 +93,7 @@ maven-dependency-plugin + 3.3.0 package @@ -109,7 +110,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -123,7 +124,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -154,7 +155,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.2 + 3.4.1 attach-javadocs @@ -177,7 +178,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.2.1 attach-sources @@ -340,17 +341,17 @@ ${java.version} 1.8.5 1.6.5 - 4.9.3 - 2.9.0 + 4.10.0 + 2.9.1 3.12.0 - 0.2.3 + 0.2.4 1.3.5 - 5.8.2 - 1.6.2 + 5.9.1 + 1.9.1 3.12.4 2.1.1 1.1.1 UTF-8 - 2.21.0 + 2.27.2 diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java index 3e8b94b1584..a21641307c5 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java @@ -278,7 +278,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); + JSON.setDateFormat(dateFormat); return this; } @@ -289,7 +289,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); + JSON.setSqlDateFormat(dateFormat); return this; } @@ -300,7 +300,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); + JSON.setOffsetDateTimeFormat(dateFormat); return this; } @@ -311,7 +311,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -322,7 +322,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + JSON.setLenientOnJson(lenientOnJson); return this; } @@ -583,7 +583,7 @@ public class ApiClient { return ""; } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -591,7 +591,7 @@ public class ApiClient { if (b.length() > 0) { b.append(","); } - b.append(String.valueOf(o)); + b.append(o); } return b.toString(); } else { @@ -842,7 +842,7 @@ public class ApiClient { contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; @@ -876,13 +876,13 @@ public class ApiClient { } else if (isJsonMime(contentType)) { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } @@ -1378,7 +1378,7 @@ public class ApiClient { } else { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } @@ -1456,7 +1456,7 @@ public class ApiClient { KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); + String certificateAlias = "ca" + (index++); caKeyStore.setCertificateEntry(certificateAlias, certificate); } trustManagerFactory.init(caKeyStore); diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java index 807f4f240ad..72a4e7910c9 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java @@ -133,15 +133,12 @@ public class PingApi { @SuppressWarnings("rawtypes") private okhttp3.Call getPingValidateBeforeCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling getPing(Async)"); } - - okhttp3.Call localVarCall = getPingCall(petId, name, status, _callback); - return localVarCall; + return getPingCall(petId, name, status, _callback); } @@ -321,10 +318,7 @@ public class PingApi { @SuppressWarnings("rawtypes") private okhttp3.Call postPingValidateBeforeCall(SomeObj someObj, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = postPingCall(someObj, _callback); - return localVarCall; + return postPingCall(someObj, _callback); } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java index 52b25858f94..dee22d566b0 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/.openapi-generator/FILES b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/.openapi-generator/FILES index 54773e481d6..d848128b34b 100644 --- a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/.openapi-generator/FILES +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/.openapi-generator/FILES @@ -6,8 +6,11 @@ common.ts configuration.ts git_push.sh index.ts +model/abstract-flat-stock-pick-order-base-dto.ts model/abstract-user-dto.ts model/branch-dto.ts +model/flat-stock-pick-order-dto-all-of.ts +model/flat-stock-pick-order-dto.ts model/index.ts model/internal-authenticated-user-dto.ts model/remote-authenticated-user-dto.ts diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/abstract-flat-stock-pick-order-base-dto.ts b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/abstract-flat-stock-pick-order-base-dto.ts new file mode 100644 index 00000000000..9604cf4c300 --- /dev/null +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/abstract-flat-stock-pick-order-base-dto.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface AbstractFlatStockPickOrderBaseDto + */ +export interface AbstractFlatStockPickOrderBaseDto { + /** + * + * @type {number} + * @memberof AbstractFlatStockPickOrderBaseDto + */ + 'id': number; + /** + * + * @type {string} + * @memberof AbstractFlatStockPickOrderBaseDto + */ + 'created'?: string; + /** + * + * @type {string} + * @memberof AbstractFlatStockPickOrderBaseDto + */ + 'lastModified'?: string; + /** + * + * @type {number} + * @memberof AbstractFlatStockPickOrderBaseDto + */ + 'warehouseId': number; + /** + * + * @type {number} + * @memberof AbstractFlatStockPickOrderBaseDto + */ + 'quantity': number; + /** + * + * @type {string} + * @memberof AbstractFlatStockPickOrderBaseDto + */ + 'stockLocation'?: string; + /** + * + * @type {string} + * @memberof AbstractFlatStockPickOrderBaseDto + */ + 'barcode'?: string; + /** + * + * @type {number} + * @memberof AbstractFlatStockPickOrderBaseDto + */ + 'pickedQuantity': number; + /** + * + * @type {string} + * @memberof AbstractFlatStockPickOrderBaseDto + */ + 'type': string; +} + diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto-all-of.ts b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto-all-of.ts new file mode 100644 index 00000000000..217dff00486 --- /dev/null +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto-all-of.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface FlatStockPickOrderDtoAllOf + */ +export interface FlatStockPickOrderDtoAllOf { + /** + * + * @type {string} + * @memberof FlatStockPickOrderDtoAllOf + */ + 'blockedUntil'?: string; + /** + * + * @type {number} + * @memberof FlatStockPickOrderDtoAllOf + */ + 'blockedById'?: number; +} + diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto.ts b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto.ts new file mode 100644 index 00000000000..f473a8d58b2 --- /dev/null +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto.ts @@ -0,0 +1,29 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { AbstractFlatStockPickOrderBaseDto } from './abstract-flat-stock-pick-order-base-dto'; +// May contain unused imports in some cases +// @ts-ignore +import { FlatStockPickOrderDtoAllOf } from './flat-stock-pick-order-dto-all-of'; + +/** + * @type FlatStockPickOrderDto + * @export + */ +export type FlatStockPickOrderDto = AbstractFlatStockPickOrderBaseDto & FlatStockPickOrderDtoAllOf; + + diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/index.ts b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/index.ts index f92a1d9cadf..3642df8da68 100644 --- a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/index.ts +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/index.ts @@ -1,4 +1,7 @@ +export * from './abstract-flat-stock-pick-order-base-dto'; export * from './abstract-user-dto'; export * from './branch-dto'; +export * from './flat-stock-pick-order-dto'; +export * from './flat-stock-pick-order-dto-all-of'; export * from './internal-authenticated-user-dto'; export * from './remote-authenticated-user-dto'; diff --git a/samples/client/others/typescript-rxjs/allOf-composition/.gitignore b/samples/client/others/typescript-rxjs/allOf-composition/.gitignore new file mode 100644 index 00000000000..149b5765472 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/others/typescript-rxjs/allOf-composition/.openapi-generator-ignore b/samples/client/others/typescript-rxjs/allOf-composition/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/others/typescript-rxjs/allOf-composition/.openapi-generator/FILES b/samples/client/others/typescript-rxjs/allOf-composition/.openapi-generator/FILES new file mode 100644 index 00000000000..89276d499a4 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/.openapi-generator/FILES @@ -0,0 +1,15 @@ +.gitignore +apis/DefaultApi.ts +apis/index.ts +index.ts +models/Hero.ts +models/Human.ts +models/SuperBaby.ts +models/SuperBabyAllOf.ts +models/SuperBoy.ts +models/SuperBoyAllOf.ts +models/SuperMan.ts +models/index.ts +runtime.ts +servers.ts +tsconfig.json diff --git a/samples/client/others/typescript-rxjs/allOf-composition/.openapi-generator/VERSION b/samples/client/others/typescript-rxjs/allOf-composition/.openapi-generator/VERSION new file mode 100644 index 00000000000..d6b4ec4aa78 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/others/typescript-rxjs/allOf-composition/apis/DefaultApi.ts b/samples/client/others/typescript-rxjs/allOf-composition/apis/DefaultApi.ts new file mode 100644 index 00000000000..50216e7be70 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/apis/DefaultApi.ts @@ -0,0 +1,44 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Observable } from 'rxjs'; +import type { AjaxResponse } from 'rxjs/ajax'; +import { BaseAPI, throwIfNullOrUndefined, encodeURI } from '../runtime'; +import type { OperationOpts } from '../runtime'; +import type { + SuperMan, +} from '../models'; + +export interface ListRequest { + personId: string; +} + +/** + * no description + */ +export class DefaultApi extends BaseAPI { + + /** + */ + list({ personId }: ListRequest): Observable + list({ personId }: ListRequest, opts?: OperationOpts): Observable> + list({ personId }: ListRequest, opts?: OperationOpts): Observable> { + throwIfNullOrUndefined(personId, 'personId', 'list'); + + return this.request({ + url: '/person/display/{personId}'.replace('{personId}', encodeURI(personId)), + method: 'GET', + }, opts?.responseOpts); + }; + +} diff --git a/samples/client/others/typescript-rxjs/allOf-composition/apis/index.ts b/samples/client/others/typescript-rxjs/allOf-composition/apis/index.ts new file mode 100644 index 00000000000..a1aa4698ff2 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/apis/index.ts @@ -0,0 +1 @@ +export * from './DefaultApi'; diff --git a/samples/client/others/typescript-rxjs/allOf-composition/index.ts b/samples/client/others/typescript-rxjs/allOf-composition/index.ts new file mode 100644 index 00000000000..b9e2f3ca3b7 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/index.ts @@ -0,0 +1,4 @@ +export * from './runtime'; +export * from './servers'; +export * from './apis'; +export * from './models'; diff --git a/samples/client/others/typescript-rxjs/allOf-composition/models/Hero.ts b/samples/client/others/typescript-rxjs/allOf-composition/models/Hero.ts new file mode 100644 index 00000000000..98c39a6ecd6 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/models/Hero.ts @@ -0,0 +1,30 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Hero + * @export + * @interface Hero + */ +export interface Hero { + /** + * @type {number} + * @memberof Hero + */ + reward?: number; + /** + * @type {string} + * @memberof Hero + */ + origin: string; +} diff --git a/samples/client/others/typescript-rxjs/allOf-composition/models/Human.ts b/samples/client/others/typescript-rxjs/allOf-composition/models/Human.ts new file mode 100644 index 00000000000..2122f4c7a13 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/models/Human.ts @@ -0,0 +1,30 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * Human + * @export + * @interface Human + */ +export interface Human { + /** + * @type {number} + * @memberof Human + */ + id: number; + /** + * @type {string} + * @memberof Human + */ + name?: string; +} diff --git a/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBaby.ts b/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBaby.ts new file mode 100644 index 00000000000..1647f9aa201 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBaby.ts @@ -0,0 +1,23 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { + Human, + SuperBabyAllOf, +} from './'; + +/** + * @type SuperBaby + * @export + */ +export type SuperBaby = Human & SuperBabyAllOf; diff --git a/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBabyAllOf.ts b/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBabyAllOf.ts new file mode 100644 index 00000000000..459c28d0f4e --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBabyAllOf.ts @@ -0,0 +1,29 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * @export + * @interface SuperBabyAllOf + */ +export interface SuperBabyAllOf { + /** + * @type {string} + * @memberof SuperBabyAllOf + */ + gender?: string; + /** + * @type {number} + * @memberof SuperBabyAllOf + */ + age?: number; +} diff --git a/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBoy.ts b/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBoy.ts new file mode 100644 index 00000000000..668faac8d17 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBoy.ts @@ -0,0 +1,23 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { + Human, + SuperBoyAllOf, +} from './'; + +/** + * @type SuperBoy + * @export + */ +export type SuperBoy = Human & SuperBoyAllOf; diff --git a/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBoyAllOf.ts b/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBoyAllOf.ts new file mode 100644 index 00000000000..26003b90c7d --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/models/SuperBoyAllOf.ts @@ -0,0 +1,29 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * @export + * @interface SuperBoyAllOf + */ +export interface SuperBoyAllOf { + /** + * @type {string} + * @memberof SuperBoyAllOf + */ + category?: string; + /** + * @type {number} + * @memberof SuperBoyAllOf + */ + level: number; +} diff --git a/samples/client/others/typescript-rxjs/allOf-composition/models/SuperMan.ts b/samples/client/others/typescript-rxjs/allOf-composition/models/SuperMan.ts new file mode 100644 index 00000000000..8548fb03519 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/models/SuperMan.ts @@ -0,0 +1,24 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { + Hero, + Human, + SuperBoyAllOf, +} from './'; + +/** + * @type SuperMan + * @export + */ +export type SuperMan = Hero & Human & SuperBoyAllOf; diff --git a/samples/client/others/typescript-rxjs/allOf-composition/models/index.ts b/samples/client/others/typescript-rxjs/allOf-composition/models/index.ts new file mode 100644 index 00000000000..d57bd6be7b9 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/models/index.ts @@ -0,0 +1,7 @@ +export * from './Hero'; +export * from './Human'; +export * from './SuperBaby'; +export * from './SuperBabyAllOf'; +export * from './SuperBoy'; +export * from './SuperBoyAllOf'; +export * from './SuperMan'; diff --git a/samples/client/others/typescript-rxjs/allOf-composition/runtime.ts b/samples/client/others/typescript-rxjs/allOf-composition/runtime.ts new file mode 100644 index 00000000000..64b0b2b4ad4 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/runtime.ts @@ -0,0 +1,193 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { of } from 'rxjs'; +import type { Observable } from 'rxjs'; +import { ajax } from 'rxjs/ajax'; +import type { AjaxConfig, AjaxResponse } from 'rxjs/ajax'; +import { map, concatMap } from 'rxjs/operators'; +import { servers } from './servers'; + +export const BASE_PATH = servers[0].getUrl(); + +export interface ConfigurationParameters { + basePath?: string; // override base path + middleware?: Middleware[]; // middleware to apply before/after rxjs requests + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | ((name: string) => string); // parameter for apiKey security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + get basePath(): string { + return this.configuration.basePath ?? BASE_PATH; + } + + get middleware(): Middleware[] { + return this.configuration.middleware ?? []; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string) | undefined { + const { apiKey } = this.configuration; + return apiKey ? (typeof apiKey === 'string' ? () => apiKey : apiKey) : undefined; + } + + get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { + const { accessToken } = this.configuration; + return accessToken ? (typeof accessToken === 'string' ? () => accessToken : accessToken) : undefined; + } +} + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + private middleware: Middleware[] = []; + + constructor(protected configuration = new Configuration()) { + this.middleware = configuration.middleware; + } + + withMiddleware = (middlewares: Middleware[]): this => { + const next = this.clone(); + next.middleware = next.middleware.concat(middlewares); + return next; + }; + + withPreMiddleware = (preMiddlewares: Array) => + this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); + + withPostMiddleware = (postMiddlewares: Array) => + this.withMiddleware(postMiddlewares.map((post) => ({ post }))); + + protected request(requestOpts: RequestOpts): Observable + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> + protected request(requestOpts: RequestOpts, responseOpts?: ResponseOpts): Observable> { + return this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( + map((res) => { + const { status, response } = res; + if (status >= 200 && status < 300) { + return responseOpts?.response === 'raw' ? res : response; + } + throw res; + }) + ); + } + + private createRequestArgs = ({ url: baseUrl, query, method, headers, body, responseType }: RequestOpts): AjaxConfig => { + // only add the queryString to the URL if there are query parameters. + // this is done to avoid urls ending with a '?' character which buggy webservers + // do not handle correctly sometimes. + const url = `${this.configuration.basePath}${baseUrl}${query && Object.keys(query).length ? `?${queryString(query)}`: ''}`; + + return { + url, + method, + headers, + body: body instanceof FormData ? body : JSON.stringify(body), + responseType: responseType ?? 'json', + }; + } + + private rxjsRequest = (params: AjaxConfig): Observable> => + of(params).pipe( + map((request) => { + this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request))); + return request; + }), + concatMap((args) => + ajax(args).pipe( + map((response) => { + this.middleware.filter((item) => item.post).forEach((mw) => (response = mw.post!(response))); + return response; + }) + ) + ) + ); + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone = (): this => + Object.assign(Object.create(Object.getPrototypeOf(this)), this); +} + +/** + * @deprecated + * export for not being a breaking change + */ +export class RequiredError extends Error { + override name: 'RequiredError' = 'RequiredError'; +} + +export const COLLECTION_FORMATS = { + csv: ',', + ssv: ' ', + tsv: '\t', + pipes: '|', +}; + +export type Json = any; +export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HttpHeaders = { [key: string]: string }; +export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode +export type HttpBody = Json | FormData; + +export interface RequestOpts extends AjaxConfig { + // TODO: replace custom 'query' prop with 'queryParams' + query?: HttpQuery; // additional prop + // the following props have improved types over AjaxRequest + method: HttpMethod; + headers?: HttpHeaders; + body?: HttpBody; +} + +export interface ResponseOpts { + response?: 'raw'; +} + +export interface OperationOpts { + responseOpts?: ResponseOpts; +} + +export const encodeURI = (value: any) => encodeURIComponent(`${value}`); + +const queryString = (params: HttpQuery): string => Object.entries(params) + .map(([key, value]) => value instanceof Array + ? value.map((val) => `${encodeURI(key)}=${encodeURI(val)}`).join('&') + : `${encodeURI(key)}=${encodeURI(value)}` + ) + .join('&'); + +export const throwIfNullOrUndefined = (value: any, paramName: string, nickname: string) => { + if (value == null) { + throw new Error(`Parameter "${paramName}" was null or undefined when calling "${nickname}".`); + } +}; + +export interface Middleware { + pre?(request: AjaxConfig): AjaxConfig; + post?(response: AjaxResponse): AjaxResponse; +} diff --git a/samples/client/others/typescript-rxjs/allOf-composition/servers.ts b/samples/client/others/typescript-rxjs/allOf-composition/servers.ts new file mode 100644 index 00000000000..3d22265d43f --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/servers.ts @@ -0,0 +1,43 @@ +/** + * + * Represents the configuration of a server including its + * url template and variable configuration based on the url. + * + */ +export class ServerConfiguration { + public constructor(private url: string, private variableConfiguration: T, private description: string) {} + + /** + * Sets the value of the variables of this server. + * + * @param variableConfiguration a partial variable configuration for the variables contained in the url + */ + public setVariables(variableConfiguration: Partial) { + Object.assign(this.variableConfiguration, variableConfiguration); + } + + public getConfiguration(): T { + return this.variableConfiguration; + } + + public getDescription(): string { + return this.description; + } + + /** + * Constructions the URL this server using the url with variables + * replaced with their respective values + */ + public getUrl(): string { + let replacedUrl = this.url; + for (const key in this.variableConfiguration) { + var re = new RegExp("{" + key + "}","g"); + replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]); + } + return replacedUrl; + } +} + +const server1 = new ServerConfiguration<{ }>("http://api.example.xyz/v1", { }, ""); + +export const servers = [server1]; diff --git a/samples/client/others/typescript-rxjs/allOf-composition/tsconfig.json b/samples/client/others/typescript-rxjs/allOf-composition/tsconfig.json new file mode 100644 index 00000000000..59a60838a05 --- /dev/null +++ b/samples/client/others/typescript-rxjs/allOf-composition/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "declaration": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "outDir": "dist", + "rootDir": ".", + "lib": [ + "es6", + "dom", + "es2017" + ], + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "dist", + "node_modules" + ] +} diff --git a/samples/client/petstore/R-httr2-wrapper/.openapi-generator/FILES b/samples/client/petstore/R-httr2-wrapper/.openapi-generator/FILES index c1007a68c4d..d272f748838 100644 --- a/samples/client/petstore/R-httr2-wrapper/.openapi-generator/FILES +++ b/samples/client/petstore/R-httr2-wrapper/.openapi-generator/FILES @@ -21,6 +21,7 @@ R/date.R R/dog.R R/dog_all_of.R R/fake_api.R +R/format_test.R R/mammal.R R/model_api_response.R R/nested_one_of.R @@ -52,6 +53,7 @@ docs/Date.md docs/Dog.md docs/DogAllOf.md docs/FakeApi.md +docs/FormatTest.md docs/Mammal.md docs/ModelApiResponse.md docs/NestedOneOf.md diff --git a/samples/client/petstore/R-httr2-wrapper/NAMESPACE b/samples/client/petstore/R-httr2-wrapper/NAMESPACE index fe9db16d34b..9abd239e110 100644 --- a/samples/client/petstore/R-httr2-wrapper/NAMESPACE +++ b/samples/client/petstore/R-httr2-wrapper/NAMESPACE @@ -28,6 +28,7 @@ export(DanishPig) export(Date) export(Dog) export(DogAllOf) +export(FormatTest) export(Mammal) export(ModelApiResponse) export(NestedOneOf) diff --git a/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R b/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R index e485c15e4ca..220d89ee503 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R +++ b/samples/client/petstore/R-httr2-wrapper/R/allof_tag_api_response.R @@ -42,23 +42,33 @@ AllofTagApiResponse <- R6::R6Class( #' @export initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } if (!is.null(`code`)) { - stopifnot(is.numeric(`code`), length(`code`) == 1) + if (!(is.numeric(`code`) && length(`code`) == 1)) { + stop(paste("Error! Invalid data for `code`. Must be an integer:", `code`)) + } self$`code` <- `code` } if (!is.null(`type`)) { - stopifnot(is.character(`type`), length(`type`) == 1) + if (!(is.character(`type`) && length(`type`) == 1)) { + stop(paste("Error! Invalid data for `type`. Must be a string:", `type`)) + } self$`type` <- `type` } if (!is.null(`message`)) { - stopifnot(is.character(`message`), length(`message`) == 1) + if (!(is.character(`message`) && length(`message`) == 1)) { + stop(paste("Error! Invalid data for `message`. Must be a string:", `message`)) + } self$`message` <- `message` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/animal.R b/samples/client/petstore/R-httr2-wrapper/R/animal.R index 632b160087d..b506bced42f 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/animal.R +++ b/samples/client/petstore/R-httr2-wrapper/R/animal.R @@ -35,11 +35,15 @@ Animal <- R6::R6Class( #' @export initialize = function(`className`, `color` = "red", additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } if (!is.null(additional_properties)) { @@ -162,7 +166,9 @@ Animal <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R b/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R index 2335bbe37c0..ac83042c8cf 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/basque_pig.R @@ -33,11 +33,15 @@ BasquePig <- R6::R6Class( #' @export initialize = function(`className`, `color`, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!missing(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } if (!is.null(additional_properties)) { @@ -160,13 +164,17 @@ BasquePig <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `className` is missing.")) } # check the required field `color` if (!is.null(input_json$`color`)) { - stopifnot(is.character(input_json$`color`), length(input_json$`color`) == 1) + if (!(is.character(input_json$`color`) && length(input_json$`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", input_json$`color`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing.")) } diff --git a/samples/client/petstore/R-httr2-wrapper/R/cat.R b/samples/client/petstore/R-httr2-wrapper/R/cat.R index 60d417950b1..f74e2d887dd 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/cat.R +++ b/samples/client/petstore/R-httr2-wrapper/R/cat.R @@ -37,15 +37,21 @@ Cat <- R6::R6Class( #' @export initialize = function(`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } if (!is.null(`declawed`)) { - stopifnot(is.logical(`declawed`), length(`declawed`) == 1) + if (!(is.logical(`declawed`) && length(`declawed`) == 1)) { + stop(paste("Error! Invalid data for `declawed`. Must be a boolean:", `declawed`)) + } self$`declawed` <- `declawed` } if (!is.null(additional_properties)) { @@ -184,7 +190,9 @@ Cat <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Cat: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R-httr2-wrapper/R/cat_all_of.R b/samples/client/petstore/R-httr2-wrapper/R/cat_all_of.R index c3969fc0550..197e1a46e3a 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/cat_all_of.R +++ b/samples/client/petstore/R-httr2-wrapper/R/cat_all_of.R @@ -30,7 +30,9 @@ CatAllOf <- R6::R6Class( #' @export initialize = function(`declawed` = NULL, additional_properties = NULL, ...) { if (!is.null(`declawed`)) { - stopifnot(is.logical(`declawed`), length(`declawed`) == 1) + if (!(is.logical(`declawed`) && length(`declawed`) == 1)) { + stop(paste("Error! Invalid data for `declawed`. Must be a boolean:", `declawed`)) + } self$`declawed` <- `declawed` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/category.R b/samples/client/petstore/R-httr2-wrapper/R/category.R index 2de263a5682..2646d01bd72 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/category.R +++ b/samples/client/petstore/R-httr2-wrapper/R/category.R @@ -33,11 +33,15 @@ Category <- R6::R6Class( #' @export initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R b/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R index 737bfad4b97..06cf5096a88 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R +++ b/samples/client/petstore/R-httr2-wrapper/R/danish_pig.R @@ -33,11 +33,15 @@ DanishPig <- R6::R6Class( #' @export initialize = function(`className`, `size`, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!missing(`size`)) { - stopifnot(is.numeric(`size`), length(`size`) == 1) + if (!(is.numeric(`size`) && length(`size`) == 1)) { + stop(paste("Error! Invalid data for `size`. Must be an integer:", `size`)) + } self$`size` <- `size` } if (!is.null(additional_properties)) { @@ -160,13 +164,17 @@ DanishPig <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `className` is missing.")) } # check the required field `size` if (!is.null(input_json$`size`)) { - stopifnot(is.numeric(input_json$`size`), length(input_json$`size`) == 1) + if (!(is.numeric(input_json$`size`) && length(input_json$`size`) == 1)) { + stop(paste("Error! Invalid data for `size`. Must be an integer:", input_json$`size`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `size` is missing.")) } diff --git a/samples/client/petstore/R-httr2-wrapper/R/date.R b/samples/client/petstore/R-httr2-wrapper/R/date.R index a26b7977d4f..79945bc8cfc 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/date.R +++ b/samples/client/petstore/R-httr2-wrapper/R/date.R @@ -36,19 +36,25 @@ Date <- R6::R6Class( #' @export initialize = function(`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!missing(`url_property`)) { - stopifnot(is.character(`url_property`), length(`url_property`) == 1) + if (!(is.character(`url_property`) && length(`url_property`) == 1)) { + stop(paste("Error! Invalid data for `url_property`. Must be a string:", `url_property`)) + } # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", `url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", `url_property`)) } self$`url_property` <- `url_property` } if (!is.null(`percent_description`)) { - stopifnot(is.character(`percent_description`), length(`percent_description`) == 1) + if (!(is.character(`percent_description`) && length(`percent_description`) == 1)) { + stop(paste("Error! Invalid data for `percent_description`. Must be a string:", `percent_description`)) + } self$`percent_description` <- `percent_description` } if (!is.null(additional_properties)) { @@ -103,7 +109,7 @@ Date <- R6::R6Class( if (!is.null(this_object$`url_property`)) { # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(this_object$`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", this_object$`url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", this_object$`url_property`)) } self$`url_property` <- this_object$`url_property` } @@ -172,7 +178,7 @@ Date <- R6::R6Class( self$`percent_description` <- this_object$`percent_description` # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(this_object$`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", this_object$`url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", this_object$`url_property`)) } self$`url_property` <- this_object$`url_property` # process additional properties/fields in the payload @@ -195,16 +201,20 @@ Date <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Date: the required field `className` is missing.")) } # check the required field `url_property` if (!is.null(input_json$`url_property`)) { - stopifnot(is.character(input_json$`url_property`), length(input_json$`url_property`) == 1) + if (!(is.character(input_json$`url_property`) && length(input_json$`url_property`) == 1)) { + stop(paste("Error! Invalid data for `url_property`. Must be a string:", input_json$`url_property`)) + } # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(input_json$`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", input_json$`url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", input_json$`url_property`)) } } else { stop(paste("The JSON input `", input, "` is invalid for Date: the required field `url_property` is missing.")) diff --git a/samples/client/petstore/R-httr2-wrapper/R/dog.R b/samples/client/petstore/R-httr2-wrapper/R/dog.R index 67fb8a315e2..a814c57d586 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/dog.R +++ b/samples/client/petstore/R-httr2-wrapper/R/dog.R @@ -37,15 +37,21 @@ Dog <- R6::R6Class( #' @export initialize = function(`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } if (!is.null(`breed`)) { - stopifnot(is.character(`breed`), length(`breed`) == 1) + if (!(is.character(`breed`) && length(`breed`) == 1)) { + stop(paste("Error! Invalid data for `breed`. Must be a string:", `breed`)) + } self$`breed` <- `breed` } if (!is.null(additional_properties)) { @@ -184,7 +190,9 @@ Dog <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Dog: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R-httr2-wrapper/R/dog_all_of.R b/samples/client/petstore/R-httr2-wrapper/R/dog_all_of.R index ea44d583d74..17608478eed 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/dog_all_of.R +++ b/samples/client/petstore/R-httr2-wrapper/R/dog_all_of.R @@ -30,7 +30,9 @@ DogAllOf <- R6::R6Class( #' @export initialize = function(`breed` = NULL, additional_properties = NULL, ...) { if (!is.null(`breed`)) { - stopifnot(is.character(`breed`), length(`breed`) == 1) + if (!(is.character(`breed`) && length(`breed`) == 1)) { + stop(paste("Error! Invalid data for `breed`. Must be a string:", `breed`)) + } self$`breed` <- `breed` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/fake_api.R b/samples/client/petstore/R-httr2-wrapper/R/fake_api.R index 73cf0e8c54e..3a3ccd3d7a1 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/fake_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/fake_api.R @@ -117,7 +117,7 @@ #' #################### add_pet_optional #################### #' #' library(petstore) -#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional) #' #' #Add a new pet to the store (optional body) #' api_instance <- petstore_api$new() @@ -155,7 +155,7 @@ #' #' library(petstore) #' var_dummy <- "dummy_example" # character | dummy required parameter -#' var_var_data_file <- "var_data_file_example" # character | header data file +#' var_var_data_file <- "var_data_file_example" # character | header data file (Optional) #' #' #test data_file to ensure it's escaped correctly #' api_instance <- petstore_api$new() @@ -188,7 +188,7 @@ #' #################### fake_path_array #################### #' #' library(petstore) -#' var_path_array <- ["path_array_example"] # array[character] | dummy path parameter +#' var_path_array <- c("inner_example") # array[character] | dummy path parameter #' #' #test array parameter in path #' api_instance <- petstore_api$new() @@ -238,8 +238,8 @@ #' #################### fake_set_query #################### #' #' library(petstore) -#' var_set_dummy <- ["set_dummy_example"] # set[character] | set query -#' var_array_dummy <- ["array_dummy_example"] # array[character] | array query +#' var_set_dummy <- c("inner_example") # set[character] | set query +#' var_array_dummy <- c("inner_example") # array[character] | array query #' #' #test set query parameter #' api_instance <- petstore_api$new() diff --git a/samples/client/petstore/R-httr2-wrapper/R/format_test.R b/samples/client/petstore/R-httr2-wrapper/R/format_test.R new file mode 100644 index 00000000000..4bd74e3a727 --- /dev/null +++ b/samples/client/petstore/R-httr2-wrapper/R/format_test.R @@ -0,0 +1,711 @@ +#' Create a new FormatTest +#' +#' @description +#' FormatTest Class +#' +#' @docType class +#' @title FormatTest +#' @description FormatTest Class +#' @format An \code{R6Class} generator object +#' @field integer integer [optional] +#' @field int32 integer [optional] +#' @field int64 integer [optional] +#' @field number numeric +#' @field float numeric [optional] +#' @field double numeric [optional] +#' @field string character [optional] +#' @field byte character +#' @field binary data.frame [optional] +#' @field date character +#' @field dateTime character [optional] +#' @field uuid character [optional] +#' @field password character +#' @field pattern_with_digits A string that is a 10 digit number. Can have leading zeros. character [optional] +#' @field pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. character [optional] +#' @field _field_list a list of fields list(character) +#' @field additional_properties additional properties list(character) [optional] +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON +#' @export +FormatTest <- R6::R6Class( + "FormatTest", + public = list( + `integer` = NULL, + `int32` = NULL, + `int64` = NULL, + `number` = NULL, + `float` = NULL, + `double` = NULL, + `string` = NULL, + `byte` = NULL, + `binary` = NULL, + `date` = NULL, + `dateTime` = NULL, + `uuid` = NULL, + `password` = NULL, + `pattern_with_digits` = NULL, + `pattern_with_digits_and_delimiter` = NULL, + `_field_list` = c("integer", "int32", "int64", "number", "float", "double", "string", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"), + `additional_properties` = list(), + #' Initialize a new FormatTest class. + #' + #' @description + #' Initialize a new FormatTest class. + #' + #' @param number number + #' @param byte byte + #' @param date date + #' @param password password + #' @param integer integer + #' @param int32 int32 + #' @param int64 int64 + #' @param float float + #' @param double double + #' @param string string + #' @param binary binary + #' @param dateTime dateTime. Default to "2015-10-28T14:38:02Z". + #' @param uuid uuid + #' @param pattern_with_digits A string that is a 10 digit number. Can have leading zeros. + #' @param pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + #' @param additional_properties additonal properties (optional) + #' @param ... Other optional arguments. + #' @export + initialize = function(`number`, `byte`, `date`, `password`, `integer` = NULL, `int32` = NULL, `int64` = NULL, `float` = NULL, `double` = NULL, `string` = NULL, `binary` = NULL, `dateTime` = "2015-10-28T14:38:02Z", `uuid` = NULL, `pattern_with_digits` = NULL, `pattern_with_digits_and_delimiter` = NULL, additional_properties = NULL, ...) { + if (!missing(`number`)) { + self$`number` <- `number` + } + if (!missing(`byte`)) { + self$`byte` <- `byte` + } + if (!missing(`date`)) { + if (!(is.character(`date`) && length(`date`) == 1)) { + stop(paste("Error! Invalid data for `date`. Must be a string:", `date`)) + } + self$`date` <- `date` + } + if (!missing(`password`)) { + if (!(is.character(`password`) && length(`password`) == 1)) { + stop(paste("Error! Invalid data for `password`. Must be a string:", `password`)) + } + self$`password` <- `password` + } + if (!is.null(`integer`)) { + if (!(is.numeric(`integer`) && length(`integer`) == 1)) { + stop(paste("Error! Invalid data for `integer`. Must be an integer:", `integer`)) + } + self$`integer` <- `integer` + } + if (!is.null(`int32`)) { + if (!(is.numeric(`int32`) && length(`int32`) == 1)) { + stop(paste("Error! Invalid data for `int32`. Must be an integer:", `int32`)) + } + self$`int32` <- `int32` + } + if (!is.null(`int64`)) { + if (!(is.numeric(`int64`) && length(`int64`) == 1)) { + stop(paste("Error! Invalid data for `int64`. Must be an integer:", `int64`)) + } + self$`int64` <- `int64` + } + if (!is.null(`float`)) { + if (!(is.numeric(`float`) && length(`float`) == 1)) { + stop(paste("Error! Invalid data for `float`. Must be a number:", `float`)) + } + self$`float` <- `float` + } + if (!is.null(`double`)) { + if (!(is.numeric(`double`) && length(`double`) == 1)) { + stop(paste("Error! Invalid data for `double`. Must be a number:", `double`)) + } + self$`double` <- `double` + } + if (!is.null(`string`)) { + if (!(is.character(`string`) && length(`string`) == 1)) { + stop(paste("Error! Invalid data for `string`. Must be a string:", `string`)) + } + self$`string` <- `string` + } + if (!is.null(`binary`)) { + self$`binary` <- `binary` + } + if (!is.null(`dateTime`)) { + if (!is.character(`dateTime`)) { + stop(paste("Error! Invalid data for `dateTime`. Must be a string:", `dateTime`)) + } + self$`dateTime` <- `dateTime` + } + if (!is.null(`uuid`)) { + if (!(is.character(`uuid`) && length(`uuid`) == 1)) { + stop(paste("Error! Invalid data for `uuid`. Must be a string:", `uuid`)) + } + self$`uuid` <- `uuid` + } + if (!is.null(`pattern_with_digits`)) { + if (!(is.character(`pattern_with_digits`) && length(`pattern_with_digits`) == 1)) { + stop(paste("Error! Invalid data for `pattern_with_digits`. Must be a string:", `pattern_with_digits`)) + } + self$`pattern_with_digits` <- `pattern_with_digits` + } + if (!is.null(`pattern_with_digits_and_delimiter`)) { + if (!(is.character(`pattern_with_digits_and_delimiter`) && length(`pattern_with_digits_and_delimiter`) == 1)) { + stop(paste("Error! Invalid data for `pattern_with_digits_and_delimiter`. Must be a string:", `pattern_with_digits_and_delimiter`)) + } + self$`pattern_with_digits_and_delimiter` <- `pattern_with_digits_and_delimiter` + } + if (!is.null(additional_properties)) { + for (key in names(additional_properties)) { + self$additional_properties[[key]] <- additional_properties[[key]] + } + } + }, + #' To JSON string + #' + #' @description + #' To JSON String + #' + #' @return FormatTest in JSON format + #' @export + toJSON = function() { + FormatTestObject <- list() + if (!is.null(self$`integer`)) { + FormatTestObject[["integer"]] <- + self$`integer` + } + if (!is.null(self$`int32`)) { + FormatTestObject[["int32"]] <- + self$`int32` + } + if (!is.null(self$`int64`)) { + FormatTestObject[["int64"]] <- + self$`int64` + } + if (!is.null(self$`number`)) { + FormatTestObject[["number"]] <- + self$`number` + } + if (!is.null(self$`float`)) { + FormatTestObject[["float"]] <- + self$`float` + } + if (!is.null(self$`double`)) { + FormatTestObject[["double"]] <- + self$`double` + } + if (!is.null(self$`string`)) { + FormatTestObject[["string"]] <- + self$`string` + } + if (!is.null(self$`byte`)) { + FormatTestObject[["byte"]] <- + self$`byte` + } + if (!is.null(self$`binary`)) { + FormatTestObject[["binary"]] <- + self$`binary` + } + if (!is.null(self$`date`)) { + FormatTestObject[["date"]] <- + self$`date` + } + if (!is.null(self$`dateTime`)) { + FormatTestObject[["dateTime"]] <- + self$`dateTime` + } + if (!is.null(self$`uuid`)) { + FormatTestObject[["uuid"]] <- + self$`uuid` + } + if (!is.null(self$`password`)) { + FormatTestObject[["password"]] <- + self$`password` + } + if (!is.null(self$`pattern_with_digits`)) { + FormatTestObject[["pattern_with_digits"]] <- + self$`pattern_with_digits` + } + if (!is.null(self$`pattern_with_digits_and_delimiter`)) { + FormatTestObject[["pattern_with_digits_and_delimiter"]] <- + self$`pattern_with_digits_and_delimiter` + } + for (key in names(self$additional_properties)) { + FormatTestObject[[key]] <- self$additional_properties[[key]] + } + + FormatTestObject + }, + #' Deserialize JSON string into an instance of FormatTest + #' + #' @description + #' Deserialize JSON string into an instance of FormatTest + #' + #' @param input_json the JSON input + #' @return the instance of FormatTest + #' @export + fromJSON = function(input_json) { + this_object <- jsonlite::fromJSON(input_json) + if (!is.null(this_object$`integer`)) { + self$`integer` <- this_object$`integer` + } + if (!is.null(this_object$`int32`)) { + self$`int32` <- this_object$`int32` + } + if (!is.null(this_object$`int64`)) { + self$`int64` <- this_object$`int64` + } + if (!is.null(this_object$`number`)) { + self$`number` <- this_object$`number` + } + if (!is.null(this_object$`float`)) { + self$`float` <- this_object$`float` + } + if (!is.null(this_object$`double`)) { + self$`double` <- this_object$`double` + } + if (!is.null(this_object$`string`)) { + self$`string` <- this_object$`string` + } + if (!is.null(this_object$`byte`)) { + self$`byte` <- this_object$`byte` + } + if (!is.null(this_object$`binary`)) { + self$`binary` <- this_object$`binary` + } + if (!is.null(this_object$`date`)) { + self$`date` <- this_object$`date` + } + if (!is.null(this_object$`dateTime`)) { + self$`dateTime` <- this_object$`dateTime` + } + if (!is.null(this_object$`uuid`)) { + self$`uuid` <- this_object$`uuid` + } + if (!is.null(this_object$`password`)) { + self$`password` <- this_object$`password` + } + if (!is.null(this_object$`pattern_with_digits`)) { + self$`pattern_with_digits` <- this_object$`pattern_with_digits` + } + if (!is.null(this_object$`pattern_with_digits_and_delimiter`)) { + self$`pattern_with_digits_and_delimiter` <- this_object$`pattern_with_digits_and_delimiter` + } + # process additional properties/fields in the payload + for (key in names(this_object)) { + if (!(key %in% self$`_field_list`)) { # json key not in list of fields + self$additional_properties[[key]] <- this_object[[key]] + } + } + + self + }, + #' To JSON string + #' + #' @description + #' To JSON String + #' + #' @return FormatTest in JSON format + #' @export + toJSONString = function() { + jsoncontent <- c( + if (!is.null(self$`integer`)) { + sprintf( + '"integer": + %d + ', + self$`integer` + ) + }, + if (!is.null(self$`int32`)) { + sprintf( + '"int32": + %d + ', + self$`int32` + ) + }, + if (!is.null(self$`int64`)) { + sprintf( + '"int64": + %d + ', + self$`int64` + ) + }, + if (!is.null(self$`number`)) { + sprintf( + '"number": + %d + ', + self$`number` + ) + }, + if (!is.null(self$`float`)) { + sprintf( + '"float": + %d + ', + self$`float` + ) + }, + if (!is.null(self$`double`)) { + sprintf( + '"double": + %d + ', + self$`double` + ) + }, + if (!is.null(self$`string`)) { + sprintf( + '"string": + "%s" + ', + self$`string` + ) + }, + if (!is.null(self$`byte`)) { + sprintf( + '"byte": + "%s" + ', + self$`byte` + ) + }, + if (!is.null(self$`binary`)) { + sprintf( + '"binary": + "%s" + ', + self$`binary` + ) + }, + if (!is.null(self$`date`)) { + sprintf( + '"date": + "%s" + ', + self$`date` + ) + }, + if (!is.null(self$`dateTime`)) { + sprintf( + '"dateTime": + "%s" + ', + self$`dateTime` + ) + }, + if (!is.null(self$`uuid`)) { + sprintf( + '"uuid": + "%s" + ', + self$`uuid` + ) + }, + if (!is.null(self$`password`)) { + sprintf( + '"password": + "%s" + ', + self$`password` + ) + }, + if (!is.null(self$`pattern_with_digits`)) { + sprintf( + '"pattern_with_digits": + "%s" + ', + self$`pattern_with_digits` + ) + }, + if (!is.null(self$`pattern_with_digits_and_delimiter`)) { + sprintf( + '"pattern_with_digits_and_delimiter": + "%s" + ', + self$`pattern_with_digits_and_delimiter` + ) + } + ) + jsoncontent <- paste(jsoncontent, collapse = ",") + json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + json_obj <- jsonlite::fromJSON(json_string) + for (key in names(self$additional_properties)) { + json_obj[[key]] <- self$additional_properties[[key]] + } + json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + }, + #' Deserialize JSON string into an instance of FormatTest + #' + #' @description + #' Deserialize JSON string into an instance of FormatTest + #' + #' @param input_json the JSON input + #' @return the instance of FormatTest + #' @export + fromJSONString = function(input_json) { + this_object <- jsonlite::fromJSON(input_json) + self$`integer` <- this_object$`integer` + self$`int32` <- this_object$`int32` + self$`int64` <- this_object$`int64` + self$`number` <- this_object$`number` + self$`float` <- this_object$`float` + self$`double` <- this_object$`double` + self$`string` <- this_object$`string` + self$`byte` <- this_object$`byte` + self$`binary` <- this_object$`binary` + self$`date` <- this_object$`date` + self$`dateTime` <- this_object$`dateTime` + self$`uuid` <- this_object$`uuid` + self$`password` <- this_object$`password` + self$`pattern_with_digits` <- this_object$`pattern_with_digits` + self$`pattern_with_digits_and_delimiter` <- this_object$`pattern_with_digits_and_delimiter` + # process additional properties/fields in the payload + for (key in names(this_object)) { + if (!(key %in% self$`_field_list`)) { # json key not in list of fields + self$additional_properties[[key]] <- this_object[[key]] + } + } + + self + }, + #' Validate JSON input with respect to FormatTest + #' + #' @description + #' Validate JSON input with respect to FormatTest and throw an exception if invalid + #' + #' @param input the JSON input + #' @export + validateJSON = function(input) { + input_json <- jsonlite::fromJSON(input) + # check the required field `number` + if (!is.null(input_json$`number`)) { + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `number` is missing.")) + } + # check the required field `byte` + if (!is.null(input_json$`byte`)) { + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `byte` is missing.")) + } + # check the required field `date` + if (!is.null(input_json$`date`)) { + if (!(is.character(input_json$`date`) && length(input_json$`date`) == 1)) { + stop(paste("Error! Invalid data for `date`. Must be a string:", input_json$`date`)) + } + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `date` is missing.")) + } + # check the required field `password` + if (!is.null(input_json$`password`)) { + if (!(is.character(input_json$`password`) && length(input_json$`password`) == 1)) { + stop(paste("Error! Invalid data for `password`. Must be a string:", input_json$`password`)) + } + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `password` is missing.")) + } + }, + #' To string (JSON format) + #' + #' @description + #' To string (JSON format) + #' + #' @return String representation of FormatTest + #' @export + toString = function() { + self$toJSONString() + }, + #' Return true if the values in all fields are valid. + #' + #' @description + #' Return true if the values in all fields are valid. + #' + #' @return true if the values in all fields are valid. + #' @export + isValid = function() { + if (self$`integer` > 100) { + return(FALSE) + } + if (self$`integer` < 10) { + return(FALSE) + } + + if (self$`int32` > 200) { + return(FALSE) + } + if (self$`int32` < 20) { + return(FALSE) + } + + # check if the required `number` is null + if (is.null(self$`number`)) { + return(FALSE) + } + + if (self$`number` > 543.2) { + return(FALSE) + } + if (self$`number` < 32.1) { + return(FALSE) + } + + if (self$`float` > 987.6) { + return(FALSE) + } + if (self$`float` < 54.3) { + return(FALSE) + } + + if (self$`double` > 123.4) { + return(FALSE) + } + if (self$`double` < 67.8) { + return(FALSE) + } + + if (!str_detect(self$`string`, "[a-z]/i")) { + return(FALSE) + } + + # check if the required `byte` is null + if (is.null(self$`byte`)) { + return(FALSE) + } + + # check if the required `date` is null + if (is.null(self$`date`)) { + return(FALSE) + } + + # check if the required `password` is null + if (is.null(self$`password`)) { + return(FALSE) + } + + if (nchar(self$`password`) > 64) { + return(FALSE) + } + if (nchar(self$`password`) < 10) { + return(FALSE) + } + + if (!str_detect(self$`pattern_with_digits`, "^\\d{10}$")) { + return(FALSE) + } + + if (!str_detect(self$`pattern_with_digits_and_delimiter`, "^image_\\d{1,3}$/i")) { + return(FALSE) + } + + TRUE + }, + #' Return a list of invalid fields (if any). + #' + #' @description + #' Return a list of invalid fields (if any). + #' + #' @return A list of invalid fields (if any). + #' @export + getInvalidFields = function() { + invalid_fields <- list() + if (self$`integer` > 100) { + invalid_fields["integer"] <- "Invalid value for `integer`, must be smaller than or equal to 100." + } + if (self$`integer` < 10) { + invalid_fields["integer"] <- "Invalid value for `integer`, must be bigger than or equal to 10." + } + + if (self$`int32` > 200) { + invalid_fields["int32"] <- "Invalid value for `int32`, must be smaller than or equal to 200." + } + if (self$`int32` < 20) { + invalid_fields["int32"] <- "Invalid value for `int32`, must be bigger than or equal to 20." + } + + # check if the required `number` is null + if (is.null(self$`number`)) { + invalid_fields["number"] <- "Non-nullable required field `number` cannot be null." + } + + if (self$`number` > 543.2) { + invalid_fields["number"] <- "Invalid value for `number`, must be smaller than or equal to 543.2." + } + if (self$`number` < 32.1) { + invalid_fields["number"] <- "Invalid value for `number`, must be bigger than or equal to 32.1." + } + + if (self$`float` > 987.6) { + invalid_fields["float"] <- "Invalid value for `float`, must be smaller than or equal to 987.6." + } + if (self$`float` < 54.3) { + invalid_fields["float"] <- "Invalid value for `float`, must be bigger than or equal to 54.3." + } + + if (self$`double` > 123.4) { + invalid_fields["double"] <- "Invalid value for `double`, must be smaller than or equal to 123.4." + } + if (self$`double` < 67.8) { + invalid_fields["double"] <- "Invalid value for `double`, must be bigger than or equal to 67.8." + } + + if (!str_detect(self$`string`, "[a-z]/i")) { + invalid_fields["string"] <- "Invalid value for `string`, must conform to the pattern [a-z]/i." + } + + # check if the required `byte` is null + if (is.null(self$`byte`)) { + invalid_fields["byte"] <- "Non-nullable required field `byte` cannot be null." + } + + # check if the required `date` is null + if (is.null(self$`date`)) { + invalid_fields["date"] <- "Non-nullable required field `date` cannot be null." + } + + # check if the required `password` is null + if (is.null(self$`password`)) { + invalid_fields["password"] <- "Non-nullable required field `password` cannot be null." + } + + if (nchar(self$`password`) > 64) { + invalid_fields["password"] <- "Invalid length for `password`, must be smaller than or equal to 64." + } + if (nchar(self$`password`) < 10) { + invalid_fields["password"] <- "Invalid length for `password`, must be bigger than or equal to 10." + } + + if (!str_detect(self$`pattern_with_digits`, "^\\d{10}$")) { + invalid_fields["pattern_with_digits"] <- "Invalid value for `pattern_with_digits`, must conform to the pattern ^\\d{10}$." + } + + if (!str_detect(self$`pattern_with_digits_and_delimiter`, "^image_\\d{1,3}$/i")) { + invalid_fields["pattern_with_digits_and_delimiter"] <- "Invalid value for `pattern_with_digits_and_delimiter`, must conform to the pattern ^image_\\d{1,3}$/i." + } + + invalid_fields + }, + #' Print the object + #' + #' @description + #' Print the object + #' + #' @export + print = function() { + print(jsonlite::prettify(self$toJSONString())) + invisible(self) + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE +) +## Uncomment below to unlock the class to allow modifications of the method or field +# FormatTest$unlock() +# +## Below is an example to define the print fnuction +# FormatTest$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) +## Uncomment below to lock the class to prevent modifications to the method or field +# FormatTest$lock() + diff --git a/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R b/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R index 03059bb5225..b0e4bbba7e9 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R +++ b/samples/client/petstore/R-httr2-wrapper/R/model_api_response.R @@ -36,15 +36,21 @@ ModelApiResponse <- R6::R6Class( #' @export initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`code`)) { - stopifnot(is.numeric(`code`), length(`code`) == 1) + if (!(is.numeric(`code`) && length(`code`) == 1)) { + stop(paste("Error! Invalid data for `code`. Must be an integer:", `code`)) + } self$`code` <- `code` } if (!is.null(`type`)) { - stopifnot(is.character(`type`), length(`type`) == 1) + if (!(is.character(`type`) && length(`type`) == 1)) { + stop(paste("Error! Invalid data for `type`. Must be a string:", `type`)) + } self$`type` <- `type` } if (!is.null(`message`)) { - stopifnot(is.character(`message`), length(`message`) == 1) + if (!(is.character(`message`) && length(`message`) == 1)) { + stop(paste("Error! Invalid data for `message`. Must be a string:", `message`)) + } self$`message` <- `message` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R b/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R index 68b0db6b371..73f4e938cbd 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R +++ b/samples/client/petstore/R-httr2-wrapper/R/nested_one_of.R @@ -33,7 +33,9 @@ NestedOneOf <- R6::R6Class( #' @export initialize = function(`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...) { if (!is.null(`size`)) { - stopifnot(is.numeric(`size`), length(`size`) == 1) + if (!(is.numeric(`size`) && length(`size`) == 1)) { + stop(paste("Error! Invalid data for `size`. Must be an integer:", `size`)) + } self$`size` <- `size` } if (!is.null(`nested_pig`)) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/order.R b/samples/client/petstore/R-httr2-wrapper/R/order.R index 6f43799918d..26646896269 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/order.R +++ b/samples/client/petstore/R-httr2-wrapper/R/order.R @@ -45,30 +45,42 @@ Order <- R6::R6Class( #' @export initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`petId`)) { - stopifnot(is.numeric(`petId`), length(`petId`) == 1) + if (!(is.numeric(`petId`) && length(`petId`) == 1)) { + stop(paste("Error! Invalid data for `petId`. Must be an integer:", `petId`)) + } self$`petId` <- `petId` } if (!is.null(`quantity`)) { - stopifnot(is.numeric(`quantity`), length(`quantity`) == 1) + if (!(is.numeric(`quantity`) && length(`quantity`) == 1)) { + stop(paste("Error! Invalid data for `quantity`. Must be an integer:", `quantity`)) + } self$`quantity` <- `quantity` } if (!is.null(`shipDate`)) { - stopifnot(is.character(`shipDate`), length(`shipDate`) == 1) + if (!is.character(`shipDate`)) { + stop(paste("Error! Invalid data for `shipDate`. Must be a string:", `shipDate`)) + } self$`shipDate` <- `shipDate` } if (!is.null(`status`)) { if (!(`status` %in% c("placed", "approved", "delivered"))) { stop(paste("Error! \"", `status`, "\" cannot be assigned to `status`. Must be \"placed\", \"approved\", \"delivered\".", sep = "")) } - stopifnot(is.character(`status`), length(`status`) == 1) + if (!(is.character(`status`) && length(`status`) == 1)) { + stop(paste("Error! Invalid data for `status`. Must be a string:", `status`)) + } self$`status` <- `status` } if (!is.null(`complete`)) { - stopifnot(is.logical(`complete`), length(`complete`) == 1) + if (!(is.logical(`complete`) && length(`complete`) == 1)) { + stop(paste("Error! Invalid data for `complete`. Must be a boolean:", `complete`)) + } self$`complete` <- `complete` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet.R b/samples/client/petstore/R-httr2-wrapper/R/pet.R index 63318448c0c..8be5a058335 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet.R @@ -45,7 +45,9 @@ Pet <- R6::R6Class( #' @export initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...) { if (!missing(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } if (!missing(`photoUrls`)) { @@ -54,7 +56,9 @@ Pet <- R6::R6Class( self$`photoUrls` <- `photoUrls` } if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`category`)) { @@ -70,7 +74,9 @@ Pet <- R6::R6Class( if (!(`status` %in% c("available", "pending", "sold"))) { stop(paste("Error! \"", `status`, "\" cannot be assigned to `status`. Must be \"available\", \"pending\", \"sold\".", sep = "")) } - stopifnot(is.character(`status`), length(`status`) == 1) + if (!(is.character(`status`) && length(`status`) == 1)) { + stop(paste("Error! Invalid data for `status`. Must be a string:", `status`)) + } self$`status` <- `status` } if (!is.null(additional_properties)) { @@ -265,7 +271,9 @@ Pet <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `name` if (!is.null(input_json$`name`)) { - stopifnot(is.character(input_json$`name`), length(input_json$`name`) == 1) + if (!(is.character(input_json$`name`) && length(input_json$`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", input_json$`name`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `name` is missing.")) } diff --git a/samples/client/petstore/R-httr2-wrapper/R/pet_api.R b/samples/client/petstore/R-httr2-wrapper/R/pet_api.R index 837c4c3d5df..c860003e125 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/pet_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/pet_api.R @@ -288,7 +288,7 @@ #' #################### add_pet #################### #' #' library(petstore) -#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store #' #' #Add a new pet to the store #' api_instance <- petstore_api$new() @@ -326,7 +326,7 @@ #' #' library(petstore) #' var_pet_id <- 56 # integer | Pet id to delete -#' var_api_key <- "api_key_example" # character | +#' var_api_key <- "api_key_example" # character | (Optional) #' #' #Deletes a pet #' api_instance <- petstore_api$new() @@ -354,7 +354,7 @@ #' #################### find_pets_by_status #################### #' #' library(petstore) -#' var_status <- ["status_example"] # array[character] | Status values that need to be considered for filter +#' var_status <- c("available") # array[character] | Status values that need to be considered for filter #' #' #Finds Pets by status #' api_instance <- petstore_api$new() @@ -390,7 +390,7 @@ #' #################### find_pets_by_tags #################### #' #' library(petstore) -#' var_tags <- ["tags_example"] # array[character] | Tags to filter by +#' var_tags <- c("inner_example") # array[character] | Tags to filter by #' #' #Finds Pets by tags #' api_instance <- petstore_api$new() @@ -537,7 +537,7 @@ #' #################### update_pet #################### #' #' library(petstore) -#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store #' #' #Update an existing pet #' api_instance <- petstore_api$new() @@ -574,8 +574,8 @@ #' #' library(petstore) #' var_pet_id <- 56 # integer | ID of pet that needs to be updated -#' var_name <- "name_example" # character | Updated name of the pet -#' var_status <- "status_example" # character | Updated status of the pet +#' var_name <- "name_example" # character | Updated name of the pet (Optional) +#' var_status <- "status_example" # character | Updated status of the pet (Optional) #' #' #Updates a pet in the store with form data #' api_instance <- petstore_api$new() @@ -601,8 +601,8 @@ #' #' library(petstore) #' var_pet_id <- 56 # integer | ID of pet to update -#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server -#' var_file <- File.new('/path/to/file') # data.frame | file to upload +#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional) +#' var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional) #' #' #uploads an image #' api_instance <- petstore_api$new() diff --git a/samples/client/petstore/R-httr2-wrapper/R/special.R b/samples/client/petstore/R-httr2-wrapper/R/special.R index 33f06cc6a67..39664bea75c 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/special.R +++ b/samples/client/petstore/R-httr2-wrapper/R/special.R @@ -56,27 +56,39 @@ Special <- R6::R6Class( self$`set_test` <- `set_test` } if (!is.null(`item_self`)) { - stopifnot(is.numeric(`item_self`), length(`item_self`) == 1) + if (!(is.numeric(`item_self`) && length(`item_self`) == 1)) { + stop(paste("Error! Invalid data for `item_self`. Must be an integer:", `item_self`)) + } self$`item_self` <- `item_self` } if (!is.null(`item_private`)) { - stopifnot(is.character(`item_private`), length(`item_private`) == 1) + if (!(is.character(`item_private`) && length(`item_private`) == 1)) { + stop(paste("Error! Invalid data for `item_private`. Must be a string:", `item_private`)) + } self$`item_private` <- `item_private` } if (!is.null(`item_super`)) { - stopifnot(is.character(`item_super`), length(`item_super`) == 1) + if (!(is.character(`item_super`) && length(`item_super`) == 1)) { + stop(paste("Error! Invalid data for `item_super`. Must be a string:", `item_super`)) + } self$`item_super` <- `item_super` } if (!is.null(`123_number`)) { - stopifnot(is.character(`123_number`), length(`123_number`) == 1) + if (!(is.character(`123_number`) && length(`123_number`) == 1)) { + stop(paste("Error! Invalid data for `123_number`. Must be a string:", `123_number`)) + } self$`123_number` <- `123_number` } if (!is.null(`array[test]`)) { - stopifnot(is.character(`array[test]`), length(`array[test]`) == 1) + if (!(is.character(`array[test]`) && length(`array[test]`) == 1)) { + stop(paste("Error! Invalid data for `array[test]`. Must be a string:", `array[test]`)) + } self$`array[test]` <- `array[test]` } if (!is.null(`empty_string`)) { - stopifnot(is.character(`empty_string`), length(`empty_string`) == 1) + if (!(is.character(`empty_string`) && length(`empty_string`) == 1)) { + stop(paste("Error! Invalid data for `empty_string`. Must be a string:", `empty_string`)) + } self$`empty_string` <- `empty_string` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/store_api.R b/samples/client/petstore/R-httr2-wrapper/R/store_api.R index 3811d0e6a45..129e5d06d2b 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/store_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/store_api.R @@ -211,7 +211,7 @@ #' #################### place_order #################### #' #' library(petstore) -#' var_order <- Order$new() # Order | order placed for purchasing the pet +#' var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet #' #' #Place an order for a pet #' api_instance <- petstore_api$new() diff --git a/samples/client/petstore/R-httr2-wrapper/R/tag.R b/samples/client/petstore/R-httr2-wrapper/R/tag.R index bd4aac10e2f..be068d1474c 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/tag.R +++ b/samples/client/petstore/R-httr2-wrapper/R/tag.R @@ -33,11 +33,15 @@ Tag <- R6::R6Class( #' @export initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/user.R b/samples/client/petstore/R-httr2-wrapper/R/user.R index 153aacb3ea5..43b51ffa41c 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/user.R +++ b/samples/client/petstore/R-httr2-wrapper/R/user.R @@ -51,35 +51,51 @@ User <- R6::R6Class( #' @export initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`username`)) { - stopifnot(is.character(`username`), length(`username`) == 1) + if (!(is.character(`username`) && length(`username`) == 1)) { + stop(paste("Error! Invalid data for `username`. Must be a string:", `username`)) + } self$`username` <- `username` } if (!is.null(`firstName`)) { - stopifnot(is.character(`firstName`), length(`firstName`) == 1) + if (!(is.character(`firstName`) && length(`firstName`) == 1)) { + stop(paste("Error! Invalid data for `firstName`. Must be a string:", `firstName`)) + } self$`firstName` <- `firstName` } if (!is.null(`lastName`)) { - stopifnot(is.character(`lastName`), length(`lastName`) == 1) + if (!(is.character(`lastName`) && length(`lastName`) == 1)) { + stop(paste("Error! Invalid data for `lastName`. Must be a string:", `lastName`)) + } self$`lastName` <- `lastName` } if (!is.null(`email`)) { - stopifnot(is.character(`email`), length(`email`) == 1) + if (!(is.character(`email`) && length(`email`) == 1)) { + stop(paste("Error! Invalid data for `email`. Must be a string:", `email`)) + } self$`email` <- `email` } if (!is.null(`password`)) { - stopifnot(is.character(`password`), length(`password`) == 1) + if (!(is.character(`password`) && length(`password`) == 1)) { + stop(paste("Error! Invalid data for `password`. Must be a string:", `password`)) + } self$`password` <- `password` } if (!is.null(`phone`)) { - stopifnot(is.character(`phone`), length(`phone`) == 1) + if (!(is.character(`phone`) && length(`phone`) == 1)) { + stop(paste("Error! Invalid data for `phone`. Must be a string:", `phone`)) + } self$`phone` <- `phone` } if (!is.null(`userStatus`)) { - stopifnot(is.numeric(`userStatus`), length(`userStatus`) == 1) + if (!(is.numeric(`userStatus`) && length(`userStatus`) == 1)) { + stop(paste("Error! Invalid data for `userStatus`. Must be an integer:", `userStatus`)) + } self$`userStatus` <- `userStatus` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R-httr2-wrapper/R/user_api.R b/samples/client/petstore/R-httr2-wrapper/R/user_api.R index bc8daa69c9d..f047afe243d 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/user_api.R +++ b/samples/client/petstore/R-httr2-wrapper/R/user_api.R @@ -197,7 +197,7 @@ #' #################### create_user #################### #' #' library(petstore) -#' var_user <- User$new() # User | Created user object +#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object #' #' #Create user #' api_instance <- petstore_api$new() @@ -225,7 +225,7 @@ #' #################### create_users_with_array_input #################### #' #' library(petstore) -#' var_user <- [User$new()] # array[User] | List of user object +#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object #' #' #Creates list of users with given input array #' api_instance <- petstore_api$new() @@ -253,7 +253,7 @@ #' #################### create_users_with_list_input #################### #' #' library(petstore) -#' var_user <- [User$new()] # array[User] | List of user object +#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object #' #' #Creates list of users with given input array #' api_instance <- petstore_api$new() @@ -404,7 +404,7 @@ #' #' library(petstore) #' var_username <- "username_example" # character | name that need to be deleted -#' var_user <- User$new() # User | Updated user object +#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object #' #' #Updated user #' api_instance <- petstore_api$new() diff --git a/samples/client/petstore/R-httr2-wrapper/R/whale.R b/samples/client/petstore/R-httr2-wrapper/R/whale.R index 936b3a2573e..dc70b1dd33e 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/whale.R +++ b/samples/client/petstore/R-httr2-wrapper/R/whale.R @@ -36,15 +36,21 @@ Whale <- R6::R6Class( #' @export initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`hasBaleen`)) { - stopifnot(is.logical(`hasBaleen`), length(`hasBaleen`) == 1) + if (!(is.logical(`hasBaleen`) && length(`hasBaleen`) == 1)) { + stop(paste("Error! Invalid data for `hasBaleen`. Must be a boolean:", `hasBaleen`)) + } self$`hasBaleen` <- `hasBaleen` } if (!is.null(`hasTeeth`)) { - stopifnot(is.logical(`hasTeeth`), length(`hasTeeth`) == 1) + if (!(is.logical(`hasTeeth`) && length(`hasTeeth`) == 1)) { + stop(paste("Error! Invalid data for `hasTeeth`. Must be a boolean:", `hasTeeth`)) + } self$`hasTeeth` <- `hasTeeth` } if (!is.null(additional_properties)) { @@ -183,7 +189,9 @@ Whale <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Whale: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R-httr2-wrapper/R/zebra.R b/samples/client/petstore/R-httr2-wrapper/R/zebra.R index 5c090e84cbb..c8d06d23d6a 100644 --- a/samples/client/petstore/R-httr2-wrapper/R/zebra.R +++ b/samples/client/petstore/R-httr2-wrapper/R/zebra.R @@ -33,14 +33,18 @@ Zebra <- R6::R6Class( #' @export initialize = function(`className`, `type` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`type`)) { if (!(`type` %in% c("plains", "mountain", "grevys"))) { stop(paste("Error! \"", `type`, "\" cannot be assigned to `type`. Must be \"plains\", \"mountain\", \"grevys\".", sep = "")) } - stopifnot(is.character(`type`), length(`type`) == 1) + if (!(is.character(`type`) && length(`type`) == 1)) { + stop(paste("Error! Invalid data for `type`. Must be a string:", `type`)) + } self$`type` <- `type` } if (!is.null(additional_properties)) { @@ -169,7 +173,9 @@ Zebra <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Zebra: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R-httr2-wrapper/README.md b/samples/client/petstore/R-httr2-wrapper/README.md index bb481451cbd..12e7b2a7aac 100644 --- a/samples/client/petstore/R-httr2-wrapper/README.md +++ b/samples/client/petstore/R-httr2-wrapper/README.md @@ -115,6 +115,7 @@ Class | Method | HTTP request | Description - [Date](docs/Date.md) - [Dog](docs/Dog.md) - [DogAllOf](docs/DogAllOf.md) + - [FormatTest](docs/FormatTest.md) - [Mammal](docs/Mammal.md) - [ModelApiResponse](docs/ModelApiResponse.md) - [NestedOneOf](docs/NestedOneOf.md) diff --git a/samples/client/petstore/R-httr2-wrapper/docs/FakeApi.md b/samples/client/petstore/R-httr2-wrapper/docs/FakeApi.md index 85182dfc8ff..67510c5f7de 100644 --- a/samples/client/petstore/R-httr2-wrapper/docs/FakeApi.md +++ b/samples/client/petstore/R-httr2-wrapper/docs/FakeApi.md @@ -25,7 +25,7 @@ library(petstore) # Add a new pet to the store (optional body) # # prepare function argument(s) -var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional) +var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional) api_instance <- petstore_api$new() # Configure HTTP basic authorization: http_auth @@ -153,7 +153,7 @@ library(petstore) # test array parameter in path # # prepare function argument(s) -var_path_array <- list("inner_example") # array[character] | dummy path parameter +var_path_array <- c("inner_example") # array[character] | dummy path parameter api_instance <- petstore_api$new() result <- tryCatch( @@ -263,8 +263,8 @@ library(petstore) # test set query parameter # # prepare function argument(s) -var_set_dummy <- list("inner_example") # set[character] | set query -var_array_dummy <- list("inner_example") # array[character] | array query +var_set_dummy <- c("inner_example") # set[character] | set query +var_array_dummy <- c("inner_example") # array[character] | array query api_instance <- petstore_api$new() result <- tryCatch( diff --git a/samples/client/petstore/R-httr2-wrapper/docs/FormatTest.md b/samples/client/petstore/R-httr2-wrapper/docs/FormatTest.md new file mode 100644 index 00000000000..1d483f62704 --- /dev/null +++ b/samples/client/petstore/R-httr2-wrapper/docs/FormatTest.md @@ -0,0 +1,23 @@ +# petstore::FormatTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **integer** | | [optional] [Max: 100] [Min: 10] +**int32** | **integer** | | [optional] [Max: 200] [Min: 20] +**int64** | **integer** | | [optional] +**number** | **numeric** | | [Max: 543.2] [Min: 32.1] +**float** | **numeric** | | [optional] [Max: 987.6] [Min: 54.3] +**double** | **numeric** | | [optional] [Max: 123.4] [Min: 67.8] +**string** | **character** | | [optional] [Pattern: [a-z]/i] +**byte** | **character** | | +**binary** | **data.frame** | | [optional] +**date** | **character** | | [default to "Fri Jul 19 00:00:00 UTC 2019"] +**dateTime** | **character** | | [optional] [default to "2015-10-28T14:38:02Z"] +**uuid** | **character** | | [optional] +**password** | **character** | | [Max. length: 64] [Min. length: 10] +**pattern_with_digits** | **character** | A string that is a 10 digit number. Can have leading zeros. | [optional] [Pattern: ^\\d{10}$] +**pattern_with_digits_and_delimiter** | **character** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [Pattern: ^image_\\d{1,3}$/i] + + diff --git a/samples/client/petstore/R-httr2-wrapper/docs/PetApi.md b/samples/client/petstore/R-httr2-wrapper/docs/PetApi.md index c7cc5d95696..e6c6c4f7980 100644 --- a/samples/client/petstore/R-httr2-wrapper/docs/PetApi.md +++ b/samples/client/petstore/R-httr2-wrapper/docs/PetApi.md @@ -30,7 +30,7 @@ library(petstore) # Add a new pet to the store # # prepare function argument(s) -var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store +var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store api_instance <- petstore_api$new() # Configure HTTP basic authorization: http_auth @@ -154,7 +154,7 @@ library(petstore) # Finds Pets by status # # prepare function argument(s) -var_status <- list("available") # array[character] | Status values that need to be considered for filter +var_status <- c("available") # array[character] | Status values that need to be considered for filter api_instance <- petstore_api$new() # Configure OAuth2 access token for authorization: petstore_auth @@ -218,7 +218,7 @@ library(petstore) # Finds Pets by tags # # prepare function argument(s) -var_tags <- list("inner_example") # array[character] | Tags to filter by +var_tags <- c("inner_example") # array[character] | Tags to filter by api_instance <- petstore_api$new() result <- tryCatch( @@ -479,7 +479,7 @@ library(petstore) # Update an existing pet # # prepare function argument(s) -var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store +var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store api_instance <- petstore_api$new() # Configure OAuth2 access token for authorization: petstore_auth diff --git a/samples/client/petstore/R-httr2-wrapper/docs/UserApi.md b/samples/client/petstore/R-httr2-wrapper/docs/UserApi.md index 4417f05e9b9..f5961a389ba 100644 --- a/samples/client/petstore/R-httr2-wrapper/docs/UserApi.md +++ b/samples/client/petstore/R-httr2-wrapper/docs/UserApi.md @@ -85,7 +85,7 @@ library(petstore) # Creates list of users with given input array # # prepare function argument(s) -var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object +var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object api_instance <- petstore_api$new() # Configure API key authorization: api_key @@ -142,7 +142,7 @@ library(petstore) # Creates list of users with given input array # # prepare function argument(s) -var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object +var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object api_instance <- petstore_api$new() # Configure API key authorization: api_key diff --git a/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_format_test.R b/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_format_test.R new file mode 100644 index 00000000000..47963949104 --- /dev/null +++ b/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_format_test.R @@ -0,0 +1,113 @@ +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate + +context("Test FormatTest") + +model_instance <- FormatTest$new() + +test_that("integer", { + # tests for the property `integer` (integer) + + # uncomment below to test the property + #expect_equal(model.instance$`integer`, "EXPECTED_RESULT") +}) + +test_that("int32", { + # tests for the property `int32` (integer) + + # uncomment below to test the property + #expect_equal(model.instance$`int32`, "EXPECTED_RESULT") +}) + +test_that("int64", { + # tests for the property `int64` (integer) + + # uncomment below to test the property + #expect_equal(model.instance$`int64`, "EXPECTED_RESULT") +}) + +test_that("number", { + # tests for the property `number` (numeric) + + # uncomment below to test the property + #expect_equal(model.instance$`number`, "EXPECTED_RESULT") +}) + +test_that("float", { + # tests for the property `float` (numeric) + + # uncomment below to test the property + #expect_equal(model.instance$`float`, "EXPECTED_RESULT") +}) + +test_that("double", { + # tests for the property `double` (numeric) + + # uncomment below to test the property + #expect_equal(model.instance$`double`, "EXPECTED_RESULT") +}) + +test_that("string", { + # tests for the property `string` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`string`, "EXPECTED_RESULT") +}) + +test_that("byte", { + # tests for the property `byte` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`byte`, "EXPECTED_RESULT") +}) + +test_that("binary", { + # tests for the property `binary` (data.frame) + + # uncomment below to test the property + #expect_equal(model.instance$`binary`, "EXPECTED_RESULT") +}) + +test_that("date", { + # tests for the property `date` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`date`, "EXPECTED_RESULT") +}) + +test_that("dateTime", { + # tests for the property `dateTime` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`dateTime`, "EXPECTED_RESULT") +}) + +test_that("uuid", { + # tests for the property `uuid` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`uuid`, "EXPECTED_RESULT") +}) + +test_that("password", { + # tests for the property `password` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`password`, "EXPECTED_RESULT") +}) + +test_that("pattern_with_digits", { + # tests for the property `pattern_with_digits` (character) + # A string that is a 10 digit number. Can have leading zeros. + + # uncomment below to test the property + #expect_equal(model.instance$`pattern_with_digits`, "EXPECTED_RESULT") +}) + +test_that("pattern_with_digits_and_delimiter", { + # tests for the property `pattern_with_digits_and_delimiter` (character) + # A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + + # uncomment below to test the property + #expect_equal(model.instance$`pattern_with_digits_and_delimiter`, "EXPECTED_RESULT") +}) diff --git a/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_petstore.R b/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_petstore.R index 7c19739714f..38ce56f5733 100644 --- a/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_petstore.R +++ b/samples/client/petstore/R-httr2-wrapper/tests/testthat/test_petstore.R @@ -600,7 +600,7 @@ test_that("Tests URL validation", { Date$public_methods$validateJSON(valid_json) # shouldn't throw exception invalid_json <- '{"className":"date","percent_description":"abc","url_property":"invalid_url"}' - expect_error(Date$public_methods$validateJSON(invalid_json), 'Error! Invalid URL: invalid_url') # should throw exception + expect_error(Date$public_methods$validateJSON(invalid_json), 'Error! Invalid data for `url_property`. Must be a URL: invalid_url') # should throw exception # test fromJSONString with valid data d <- Date$new() @@ -611,5 +611,15 @@ test_that("Tests URL validation", { # test fromJSONString with invalid data d <- Date$new() - expect_error(d$fromJSONString(invalid_json), 'Error! Invalid URL: invalid_url') # should throw exception + expect_error(d$fromJSONString(invalid_json), 'Error! Invalid data for `url_property`. Must be a URL: invalid_url') # should throw exception +}) + + +test_that("Order and datetime test", { + # test tag + t <- Order$new(id = 393, petId = 12930, quantity = 12, shipDate = "2019-09-29T19:39:29Z", status = "approved") + + expect_equal(t$toJSONString(), "{\"id\":393,\"petId\":12930,\"quantity\":12,\"shipDate\":\"2019-09-29T19:39:29Z\",\"status\":\"approved\",\"complete\":false}") + + expect_error(Order$new(id = 393, petId = 12930, quantity = 12, shipDate = TRUE, status = "approved"), "Error! Invalid data for `shipDate`. Must be a string: TRUE") }) diff --git a/samples/client/petstore/R-httr2/.openapi-generator/FILES b/samples/client/petstore/R-httr2/.openapi-generator/FILES index d539ea462da..766a7cea2d5 100644 --- a/samples/client/petstore/R-httr2/.openapi-generator/FILES +++ b/samples/client/petstore/R-httr2/.openapi-generator/FILES @@ -21,6 +21,7 @@ R/date.R R/dog.R R/dog_all_of.R R/fake_api.R +R/format_test.R R/mammal.R R/model_api_response.R R/nested_one_of.R @@ -51,6 +52,7 @@ docs/Date.md docs/Dog.md docs/DogAllOf.md docs/FakeApi.md +docs/FormatTest.md docs/Mammal.md docs/ModelApiResponse.md docs/NestedOneOf.md diff --git a/samples/client/petstore/R-httr2/NAMESPACE b/samples/client/petstore/R-httr2/NAMESPACE index fbdc3618b41..4337308c71a 100644 --- a/samples/client/petstore/R-httr2/NAMESPACE +++ b/samples/client/petstore/R-httr2/NAMESPACE @@ -26,6 +26,7 @@ export(DanishPig) export(Date) export(Dog) export(DogAllOf) +export(FormatTest) export(Mammal) export(ModelApiResponse) export(NestedOneOf) diff --git a/samples/client/petstore/R-httr2/R/allof_tag_api_response.R b/samples/client/petstore/R-httr2/R/allof_tag_api_response.R index de8c4c80034..c4134b53e68 100644 --- a/samples/client/petstore/R-httr2/R/allof_tag_api_response.R +++ b/samples/client/petstore/R-httr2/R/allof_tag_api_response.R @@ -37,23 +37,33 @@ AllofTagApiResponse <- R6::R6Class( #' @export initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } if (!is.null(`code`)) { - stopifnot(is.numeric(`code`), length(`code`) == 1) + if (!(is.numeric(`code`) && length(`code`) == 1)) { + stop(paste("Error! Invalid data for `code`. Must be an integer:", `code`)) + } self$`code` <- `code` } if (!is.null(`type`)) { - stopifnot(is.character(`type`), length(`type`) == 1) + if (!(is.character(`type`) && length(`type`) == 1)) { + stop(paste("Error! Invalid data for `type`. Must be a string:", `type`)) + } self$`type` <- `type` } if (!is.null(`message`)) { - stopifnot(is.character(`message`), length(`message`) == 1) + if (!(is.character(`message`) && length(`message`) == 1)) { + stop(paste("Error! Invalid data for `message`. Must be a string:", `message`)) + } self$`message` <- `message` } }, diff --git a/samples/client/petstore/R-httr2/R/animal.R b/samples/client/petstore/R-httr2/R/animal.R index f111fd1252b..6b4d78ff5ed 100644 --- a/samples/client/petstore/R-httr2/R/animal.R +++ b/samples/client/petstore/R-httr2/R/animal.R @@ -30,11 +30,15 @@ Animal <- R6::R6Class( #' @export initialize = function(`className`, `color` = "red", ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } }, @@ -129,7 +133,9 @@ Animal <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R-httr2/R/basque_pig.R b/samples/client/petstore/R-httr2/R/basque_pig.R index 0a83d2b2548..28a10e6ddc4 100644 --- a/samples/client/petstore/R-httr2/R/basque_pig.R +++ b/samples/client/petstore/R-httr2/R/basque_pig.R @@ -28,11 +28,15 @@ BasquePig <- R6::R6Class( #' @export initialize = function(`className`, `color`, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!missing(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } }, @@ -127,13 +131,17 @@ BasquePig <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `className` is missing.")) } # check the required field `color` if (!is.null(input_json$`color`)) { - stopifnot(is.character(input_json$`color`), length(input_json$`color`) == 1) + if (!(is.character(input_json$`color`) && length(input_json$`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", input_json$`color`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing.")) } diff --git a/samples/client/petstore/R-httr2/R/cat.R b/samples/client/petstore/R-httr2/R/cat.R index f9bfc07a9ab..eaba966de58 100644 --- a/samples/client/petstore/R-httr2/R/cat.R +++ b/samples/client/petstore/R-httr2/R/cat.R @@ -32,15 +32,21 @@ Cat <- R6::R6Class( #' @export initialize = function(`className`, `color` = "red", `declawed` = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } if (!is.null(`declawed`)) { - stopifnot(is.logical(`declawed`), length(`declawed`) == 1) + if (!(is.logical(`declawed`) && length(`declawed`) == 1)) { + stop(paste("Error! Invalid data for `declawed`. Must be a boolean:", `declawed`)) + } self$`declawed` <- `declawed` } }, @@ -151,7 +157,9 @@ Cat <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Cat: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R-httr2/R/cat_all_of.R b/samples/client/petstore/R-httr2/R/cat_all_of.R index b54b944cd26..d2889ac4990 100644 --- a/samples/client/petstore/R-httr2/R/cat_all_of.R +++ b/samples/client/petstore/R-httr2/R/cat_all_of.R @@ -25,7 +25,9 @@ CatAllOf <- R6::R6Class( #' @export initialize = function(`declawed` = NULL, ...) { if (!is.null(`declawed`)) { - stopifnot(is.logical(`declawed`), length(`declawed`) == 1) + if (!(is.logical(`declawed`) && length(`declawed`) == 1)) { + stop(paste("Error! Invalid data for `declawed`. Must be a boolean:", `declawed`)) + } self$`declawed` <- `declawed` } }, diff --git a/samples/client/petstore/R-httr2/R/category.R b/samples/client/petstore/R-httr2/R/category.R index ab4f475202e..82c56228604 100644 --- a/samples/client/petstore/R-httr2/R/category.R +++ b/samples/client/petstore/R-httr2/R/category.R @@ -28,11 +28,15 @@ Category <- R6::R6Class( #' @export initialize = function(`id` = NULL, `name` = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } }, diff --git a/samples/client/petstore/R-httr2/R/danish_pig.R b/samples/client/petstore/R-httr2/R/danish_pig.R index 206cdeca85a..aea435d0fbf 100644 --- a/samples/client/petstore/R-httr2/R/danish_pig.R +++ b/samples/client/petstore/R-httr2/R/danish_pig.R @@ -28,11 +28,15 @@ DanishPig <- R6::R6Class( #' @export initialize = function(`className`, `size`, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!missing(`size`)) { - stopifnot(is.numeric(`size`), length(`size`) == 1) + if (!(is.numeric(`size`) && length(`size`) == 1)) { + stop(paste("Error! Invalid data for `size`. Must be an integer:", `size`)) + } self$`size` <- `size` } }, @@ -127,13 +131,17 @@ DanishPig <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `className` is missing.")) } # check the required field `size` if (!is.null(input_json$`size`)) { - stopifnot(is.numeric(input_json$`size`), length(input_json$`size`) == 1) + if (!(is.numeric(input_json$`size`) && length(input_json$`size`) == 1)) { + stop(paste("Error! Invalid data for `size`. Must be an integer:", input_json$`size`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `size` is missing.")) } diff --git a/samples/client/petstore/R-httr2/R/date.R b/samples/client/petstore/R-httr2/R/date.R index 8af974b7ae5..a188cad8fce 100644 --- a/samples/client/petstore/R-httr2/R/date.R +++ b/samples/client/petstore/R-httr2/R/date.R @@ -31,19 +31,25 @@ Date <- R6::R6Class( #' @export initialize = function(`className`, `url_property`, `percent_description` = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!missing(`url_property`)) { - stopifnot(is.character(`url_property`), length(`url_property`) == 1) + if (!(is.character(`url_property`) && length(`url_property`) == 1)) { + stop(paste("Error! Invalid data for `url_property`. Must be a string:", `url_property`)) + } # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", `url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", `url_property`)) } self$`url_property` <- `url_property` } if (!is.null(`percent_description`)) { - stopifnot(is.character(`percent_description`), length(`percent_description`) == 1) + if (!(is.character(`percent_description`) && length(`percent_description`) == 1)) { + stop(paste("Error! Invalid data for `percent_description`. Must be a string:", `percent_description`)) + } self$`percent_description` <- `percent_description` } }, @@ -89,7 +95,7 @@ Date <- R6::R6Class( if (!is.null(this_object$`url_property`)) { # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(this_object$`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", this_object$`url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", this_object$`url_property`)) } self$`url_property` <- this_object$`url_property` } @@ -146,7 +152,7 @@ Date <- R6::R6Class( self$`percent_description` <- this_object$`percent_description` # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(this_object$`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", this_object$`url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", this_object$`url_property`)) } self$`url_property` <- this_object$`url_property` self @@ -162,16 +168,20 @@ Date <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Date: the required field `className` is missing.")) } # check the required field `url_property` if (!is.null(input_json$`url_property`)) { - stopifnot(is.character(input_json$`url_property`), length(input_json$`url_property`) == 1) + if (!(is.character(input_json$`url_property`) && length(input_json$`url_property`) == 1)) { + stop(paste("Error! Invalid data for `url_property`. Must be a string:", input_json$`url_property`)) + } # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(input_json$`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", input_json$`url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", input_json$`url_property`)) } } else { stop(paste("The JSON input `", input, "` is invalid for Date: the required field `url_property` is missing.")) diff --git a/samples/client/petstore/R-httr2/R/dog.R b/samples/client/petstore/R-httr2/R/dog.R index 75299cdfc78..9585ef81a58 100644 --- a/samples/client/petstore/R-httr2/R/dog.R +++ b/samples/client/petstore/R-httr2/R/dog.R @@ -32,15 +32,21 @@ Dog <- R6::R6Class( #' @export initialize = function(`className`, `color` = "red", `breed` = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } if (!is.null(`breed`)) { - stopifnot(is.character(`breed`), length(`breed`) == 1) + if (!(is.character(`breed`) && length(`breed`) == 1)) { + stop(paste("Error! Invalid data for `breed`. Must be a string:", `breed`)) + } self$`breed` <- `breed` } }, @@ -151,7 +157,9 @@ Dog <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Dog: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R-httr2/R/dog_all_of.R b/samples/client/petstore/R-httr2/R/dog_all_of.R index fc8e7d0a6d6..c9ad5531225 100644 --- a/samples/client/petstore/R-httr2/R/dog_all_of.R +++ b/samples/client/petstore/R-httr2/R/dog_all_of.R @@ -25,7 +25,9 @@ DogAllOf <- R6::R6Class( #' @export initialize = function(`breed` = NULL, ...) { if (!is.null(`breed`)) { - stopifnot(is.character(`breed`), length(`breed`) == 1) + if (!(is.character(`breed`) && length(`breed`) == 1)) { + stop(paste("Error! Invalid data for `breed`. Must be a string:", `breed`)) + } self$`breed` <- `breed` } }, diff --git a/samples/client/petstore/R-httr2/R/fake_api.R b/samples/client/petstore/R-httr2/R/fake_api.R index 3ead57443af..e5977eb139a 100644 --- a/samples/client/petstore/R-httr2/R/fake_api.R +++ b/samples/client/petstore/R-httr2/R/fake_api.R @@ -117,7 +117,7 @@ #' #################### add_pet_optional #################### #' #' library(petstore) -#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional) #' #' #Add a new pet to the store (optional body) #' api_instance <- FakeApi$new() @@ -155,7 +155,7 @@ #' #' library(petstore) #' var_dummy <- "dummy_example" # character | dummy required parameter -#' var_var_data_file <- "var_data_file_example" # character | header data file +#' var_var_data_file <- "var_data_file_example" # character | header data file (Optional) #' #' #test data_file to ensure it's escaped correctly #' api_instance <- FakeApi$new() @@ -188,7 +188,7 @@ #' #################### fake_path_array #################### #' #' library(petstore) -#' var_path_array <- ["path_array_example"] # array[character] | dummy path parameter +#' var_path_array <- c("inner_example") # array[character] | dummy path parameter #' #' #test array parameter in path #' api_instance <- FakeApi$new() @@ -238,8 +238,8 @@ #' #################### fake_set_query #################### #' #' library(petstore) -#' var_set_dummy <- ["set_dummy_example"] # set[character] | set query -#' var_array_dummy <- ["array_dummy_example"] # array[character] | array query +#' var_set_dummy <- c("inner_example") # set[character] | set query +#' var_array_dummy <- c("inner_example") # array[character] | array query #' #' #test set query parameter #' api_instance <- FakeApi$new() diff --git a/samples/client/petstore/R-httr2/R/format_test.R b/samples/client/petstore/R-httr2/R/format_test.R new file mode 100644 index 00000000000..8361a769f0f --- /dev/null +++ b/samples/client/petstore/R-httr2/R/format_test.R @@ -0,0 +1,678 @@ +#' Create a new FormatTest +#' +#' @description +#' FormatTest Class +#' +#' @docType class +#' @title FormatTest +#' @description FormatTest Class +#' @format An \code{R6Class} generator object +#' @field integer integer [optional] +#' @field int32 integer [optional] +#' @field int64 integer [optional] +#' @field number numeric +#' @field float numeric [optional] +#' @field double numeric [optional] +#' @field string character [optional] +#' @field byte character +#' @field binary data.frame [optional] +#' @field date character +#' @field dateTime character [optional] +#' @field uuid character [optional] +#' @field password character +#' @field pattern_with_digits A string that is a 10 digit number. Can have leading zeros. character [optional] +#' @field pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. character [optional] +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON +#' @export +FormatTest <- R6::R6Class( + "FormatTest", + public = list( + `integer` = NULL, + `int32` = NULL, + `int64` = NULL, + `number` = NULL, + `float` = NULL, + `double` = NULL, + `string` = NULL, + `byte` = NULL, + `binary` = NULL, + `date` = NULL, + `dateTime` = NULL, + `uuid` = NULL, + `password` = NULL, + `pattern_with_digits` = NULL, + `pattern_with_digits_and_delimiter` = NULL, + #' Initialize a new FormatTest class. + #' + #' @description + #' Initialize a new FormatTest class. + #' + #' @param number number + #' @param byte byte + #' @param date date + #' @param password password + #' @param integer integer + #' @param int32 int32 + #' @param int64 int64 + #' @param float float + #' @param double double + #' @param string string + #' @param binary binary + #' @param dateTime dateTime. Default to "2015-10-28T14:38:02Z". + #' @param uuid uuid + #' @param pattern_with_digits A string that is a 10 digit number. Can have leading zeros. + #' @param pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + #' @param ... Other optional arguments. + #' @export + initialize = function(`number`, `byte`, `date`, `password`, `integer` = NULL, `int32` = NULL, `int64` = NULL, `float` = NULL, `double` = NULL, `string` = NULL, `binary` = NULL, `dateTime` = "2015-10-28T14:38:02Z", `uuid` = NULL, `pattern_with_digits` = NULL, `pattern_with_digits_and_delimiter` = NULL, ...) { + if (!missing(`number`)) { + self$`number` <- `number` + } + if (!missing(`byte`)) { + self$`byte` <- `byte` + } + if (!missing(`date`)) { + if (!(is.character(`date`) && length(`date`) == 1)) { + stop(paste("Error! Invalid data for `date`. Must be a string:", `date`)) + } + self$`date` <- `date` + } + if (!missing(`password`)) { + if (!(is.character(`password`) && length(`password`) == 1)) { + stop(paste("Error! Invalid data for `password`. Must be a string:", `password`)) + } + self$`password` <- `password` + } + if (!is.null(`integer`)) { + if (!(is.numeric(`integer`) && length(`integer`) == 1)) { + stop(paste("Error! Invalid data for `integer`. Must be an integer:", `integer`)) + } + self$`integer` <- `integer` + } + if (!is.null(`int32`)) { + if (!(is.numeric(`int32`) && length(`int32`) == 1)) { + stop(paste("Error! Invalid data for `int32`. Must be an integer:", `int32`)) + } + self$`int32` <- `int32` + } + if (!is.null(`int64`)) { + if (!(is.numeric(`int64`) && length(`int64`) == 1)) { + stop(paste("Error! Invalid data for `int64`. Must be an integer:", `int64`)) + } + self$`int64` <- `int64` + } + if (!is.null(`float`)) { + if (!(is.numeric(`float`) && length(`float`) == 1)) { + stop(paste("Error! Invalid data for `float`. Must be a number:", `float`)) + } + self$`float` <- `float` + } + if (!is.null(`double`)) { + if (!(is.numeric(`double`) && length(`double`) == 1)) { + stop(paste("Error! Invalid data for `double`. Must be a number:", `double`)) + } + self$`double` <- `double` + } + if (!is.null(`string`)) { + if (!(is.character(`string`) && length(`string`) == 1)) { + stop(paste("Error! Invalid data for `string`. Must be a string:", `string`)) + } + self$`string` <- `string` + } + if (!is.null(`binary`)) { + self$`binary` <- `binary` + } + if (!is.null(`dateTime`)) { + if (!is.character(`dateTime`)) { + stop(paste("Error! Invalid data for `dateTime`. Must be a string:", `dateTime`)) + } + self$`dateTime` <- `dateTime` + } + if (!is.null(`uuid`)) { + if (!(is.character(`uuid`) && length(`uuid`) == 1)) { + stop(paste("Error! Invalid data for `uuid`. Must be a string:", `uuid`)) + } + self$`uuid` <- `uuid` + } + if (!is.null(`pattern_with_digits`)) { + if (!(is.character(`pattern_with_digits`) && length(`pattern_with_digits`) == 1)) { + stop(paste("Error! Invalid data for `pattern_with_digits`. Must be a string:", `pattern_with_digits`)) + } + self$`pattern_with_digits` <- `pattern_with_digits` + } + if (!is.null(`pattern_with_digits_and_delimiter`)) { + if (!(is.character(`pattern_with_digits_and_delimiter`) && length(`pattern_with_digits_and_delimiter`) == 1)) { + stop(paste("Error! Invalid data for `pattern_with_digits_and_delimiter`. Must be a string:", `pattern_with_digits_and_delimiter`)) + } + self$`pattern_with_digits_and_delimiter` <- `pattern_with_digits_and_delimiter` + } + }, + #' To JSON string + #' + #' @description + #' To JSON String + #' + #' @return FormatTest in JSON format + #' @export + toJSON = function() { + FormatTestObject <- list() + if (!is.null(self$`integer`)) { + FormatTestObject[["integer"]] <- + self$`integer` + } + if (!is.null(self$`int32`)) { + FormatTestObject[["int32"]] <- + self$`int32` + } + if (!is.null(self$`int64`)) { + FormatTestObject[["int64"]] <- + self$`int64` + } + if (!is.null(self$`number`)) { + FormatTestObject[["number"]] <- + self$`number` + } + if (!is.null(self$`float`)) { + FormatTestObject[["float"]] <- + self$`float` + } + if (!is.null(self$`double`)) { + FormatTestObject[["double"]] <- + self$`double` + } + if (!is.null(self$`string`)) { + FormatTestObject[["string"]] <- + self$`string` + } + if (!is.null(self$`byte`)) { + FormatTestObject[["byte"]] <- + self$`byte` + } + if (!is.null(self$`binary`)) { + FormatTestObject[["binary"]] <- + self$`binary` + } + if (!is.null(self$`date`)) { + FormatTestObject[["date"]] <- + self$`date` + } + if (!is.null(self$`dateTime`)) { + FormatTestObject[["dateTime"]] <- + self$`dateTime` + } + if (!is.null(self$`uuid`)) { + FormatTestObject[["uuid"]] <- + self$`uuid` + } + if (!is.null(self$`password`)) { + FormatTestObject[["password"]] <- + self$`password` + } + if (!is.null(self$`pattern_with_digits`)) { + FormatTestObject[["pattern_with_digits"]] <- + self$`pattern_with_digits` + } + if (!is.null(self$`pattern_with_digits_and_delimiter`)) { + FormatTestObject[["pattern_with_digits_and_delimiter"]] <- + self$`pattern_with_digits_and_delimiter` + } + FormatTestObject + }, + #' Deserialize JSON string into an instance of FormatTest + #' + #' @description + #' Deserialize JSON string into an instance of FormatTest + #' + #' @param input_json the JSON input + #' @return the instance of FormatTest + #' @export + fromJSON = function(input_json) { + this_object <- jsonlite::fromJSON(input_json) + if (!is.null(this_object$`integer`)) { + self$`integer` <- this_object$`integer` + } + if (!is.null(this_object$`int32`)) { + self$`int32` <- this_object$`int32` + } + if (!is.null(this_object$`int64`)) { + self$`int64` <- this_object$`int64` + } + if (!is.null(this_object$`number`)) { + self$`number` <- this_object$`number` + } + if (!is.null(this_object$`float`)) { + self$`float` <- this_object$`float` + } + if (!is.null(this_object$`double`)) { + self$`double` <- this_object$`double` + } + if (!is.null(this_object$`string`)) { + self$`string` <- this_object$`string` + } + if (!is.null(this_object$`byte`)) { + self$`byte` <- this_object$`byte` + } + if (!is.null(this_object$`binary`)) { + self$`binary` <- this_object$`binary` + } + if (!is.null(this_object$`date`)) { + self$`date` <- this_object$`date` + } + if (!is.null(this_object$`dateTime`)) { + self$`dateTime` <- this_object$`dateTime` + } + if (!is.null(this_object$`uuid`)) { + self$`uuid` <- this_object$`uuid` + } + if (!is.null(this_object$`password`)) { + self$`password` <- this_object$`password` + } + if (!is.null(this_object$`pattern_with_digits`)) { + self$`pattern_with_digits` <- this_object$`pattern_with_digits` + } + if (!is.null(this_object$`pattern_with_digits_and_delimiter`)) { + self$`pattern_with_digits_and_delimiter` <- this_object$`pattern_with_digits_and_delimiter` + } + self + }, + #' To JSON string + #' + #' @description + #' To JSON String + #' + #' @return FormatTest in JSON format + #' @export + toJSONString = function() { + jsoncontent <- c( + if (!is.null(self$`integer`)) { + sprintf( + '"integer": + %d + ', + self$`integer` + ) + }, + if (!is.null(self$`int32`)) { + sprintf( + '"int32": + %d + ', + self$`int32` + ) + }, + if (!is.null(self$`int64`)) { + sprintf( + '"int64": + %d + ', + self$`int64` + ) + }, + if (!is.null(self$`number`)) { + sprintf( + '"number": + %d + ', + self$`number` + ) + }, + if (!is.null(self$`float`)) { + sprintf( + '"float": + %d + ', + self$`float` + ) + }, + if (!is.null(self$`double`)) { + sprintf( + '"double": + %d + ', + self$`double` + ) + }, + if (!is.null(self$`string`)) { + sprintf( + '"string": + "%s" + ', + self$`string` + ) + }, + if (!is.null(self$`byte`)) { + sprintf( + '"byte": + "%s" + ', + self$`byte` + ) + }, + if (!is.null(self$`binary`)) { + sprintf( + '"binary": + "%s" + ', + self$`binary` + ) + }, + if (!is.null(self$`date`)) { + sprintf( + '"date": + "%s" + ', + self$`date` + ) + }, + if (!is.null(self$`dateTime`)) { + sprintf( + '"dateTime": + "%s" + ', + self$`dateTime` + ) + }, + if (!is.null(self$`uuid`)) { + sprintf( + '"uuid": + "%s" + ', + self$`uuid` + ) + }, + if (!is.null(self$`password`)) { + sprintf( + '"password": + "%s" + ', + self$`password` + ) + }, + if (!is.null(self$`pattern_with_digits`)) { + sprintf( + '"pattern_with_digits": + "%s" + ', + self$`pattern_with_digits` + ) + }, + if (!is.null(self$`pattern_with_digits_and_delimiter`)) { + sprintf( + '"pattern_with_digits_and_delimiter": + "%s" + ', + self$`pattern_with_digits_and_delimiter` + ) + } + ) + jsoncontent <- paste(jsoncontent, collapse = ",") + json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + }, + #' Deserialize JSON string into an instance of FormatTest + #' + #' @description + #' Deserialize JSON string into an instance of FormatTest + #' + #' @param input_json the JSON input + #' @return the instance of FormatTest + #' @export + fromJSONString = function(input_json) { + this_object <- jsonlite::fromJSON(input_json) + self$`integer` <- this_object$`integer` + self$`int32` <- this_object$`int32` + self$`int64` <- this_object$`int64` + self$`number` <- this_object$`number` + self$`float` <- this_object$`float` + self$`double` <- this_object$`double` + self$`string` <- this_object$`string` + self$`byte` <- this_object$`byte` + self$`binary` <- this_object$`binary` + self$`date` <- this_object$`date` + self$`dateTime` <- this_object$`dateTime` + self$`uuid` <- this_object$`uuid` + self$`password` <- this_object$`password` + self$`pattern_with_digits` <- this_object$`pattern_with_digits` + self$`pattern_with_digits_and_delimiter` <- this_object$`pattern_with_digits_and_delimiter` + self + }, + #' Validate JSON input with respect to FormatTest + #' + #' @description + #' Validate JSON input with respect to FormatTest and throw an exception if invalid + #' + #' @param input the JSON input + #' @export + validateJSON = function(input) { + input_json <- jsonlite::fromJSON(input) + # check the required field `number` + if (!is.null(input_json$`number`)) { + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `number` is missing.")) + } + # check the required field `byte` + if (!is.null(input_json$`byte`)) { + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `byte` is missing.")) + } + # check the required field `date` + if (!is.null(input_json$`date`)) { + if (!(is.character(input_json$`date`) && length(input_json$`date`) == 1)) { + stop(paste("Error! Invalid data for `date`. Must be a string:", input_json$`date`)) + } + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `date` is missing.")) + } + # check the required field `password` + if (!is.null(input_json$`password`)) { + if (!(is.character(input_json$`password`) && length(input_json$`password`) == 1)) { + stop(paste("Error! Invalid data for `password`. Must be a string:", input_json$`password`)) + } + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `password` is missing.")) + } + }, + #' To string (JSON format) + #' + #' @description + #' To string (JSON format) + #' + #' @return String representation of FormatTest + #' @export + toString = function() { + self$toJSONString() + }, + #' Return true if the values in all fields are valid. + #' + #' @description + #' Return true if the values in all fields are valid. + #' + #' @return true if the values in all fields are valid. + #' @export + isValid = function() { + if (self$`integer` > 100) { + return(FALSE) + } + if (self$`integer` < 10) { + return(FALSE) + } + + if (self$`int32` > 200) { + return(FALSE) + } + if (self$`int32` < 20) { + return(FALSE) + } + + # check if the required `number` is null + if (is.null(self$`number`)) { + return(FALSE) + } + + if (self$`number` > 543.2) { + return(FALSE) + } + if (self$`number` < 32.1) { + return(FALSE) + } + + if (self$`float` > 987.6) { + return(FALSE) + } + if (self$`float` < 54.3) { + return(FALSE) + } + + if (self$`double` > 123.4) { + return(FALSE) + } + if (self$`double` < 67.8) { + return(FALSE) + } + + if (!str_detect(self$`string`, "[a-z]/i")) { + return(FALSE) + } + + # check if the required `byte` is null + if (is.null(self$`byte`)) { + return(FALSE) + } + + # check if the required `date` is null + if (is.null(self$`date`)) { + return(FALSE) + } + + # check if the required `password` is null + if (is.null(self$`password`)) { + return(FALSE) + } + + if (nchar(self$`password`) > 64) { + return(FALSE) + } + if (nchar(self$`password`) < 10) { + return(FALSE) + } + + if (!str_detect(self$`pattern_with_digits`, "^\\d{10}$")) { + return(FALSE) + } + + if (!str_detect(self$`pattern_with_digits_and_delimiter`, "^image_\\d{1,3}$/i")) { + return(FALSE) + } + + TRUE + }, + #' Return a list of invalid fields (if any). + #' + #' @description + #' Return a list of invalid fields (if any). + #' + #' @return A list of invalid fields (if any). + #' @export + getInvalidFields = function() { + invalid_fields <- list() + if (self$`integer` > 100) { + invalid_fields["integer"] <- "Invalid value for `integer`, must be smaller than or equal to 100." + } + if (self$`integer` < 10) { + invalid_fields["integer"] <- "Invalid value for `integer`, must be bigger than or equal to 10." + } + + if (self$`int32` > 200) { + invalid_fields["int32"] <- "Invalid value for `int32`, must be smaller than or equal to 200." + } + if (self$`int32` < 20) { + invalid_fields["int32"] <- "Invalid value for `int32`, must be bigger than or equal to 20." + } + + # check if the required `number` is null + if (is.null(self$`number`)) { + invalid_fields["number"] <- "Non-nullable required field `number` cannot be null." + } + + if (self$`number` > 543.2) { + invalid_fields["number"] <- "Invalid value for `number`, must be smaller than or equal to 543.2." + } + if (self$`number` < 32.1) { + invalid_fields["number"] <- "Invalid value for `number`, must be bigger than or equal to 32.1." + } + + if (self$`float` > 987.6) { + invalid_fields["float"] <- "Invalid value for `float`, must be smaller than or equal to 987.6." + } + if (self$`float` < 54.3) { + invalid_fields["float"] <- "Invalid value for `float`, must be bigger than or equal to 54.3." + } + + if (self$`double` > 123.4) { + invalid_fields["double"] <- "Invalid value for `double`, must be smaller than or equal to 123.4." + } + if (self$`double` < 67.8) { + invalid_fields["double"] <- "Invalid value for `double`, must be bigger than or equal to 67.8." + } + + if (!str_detect(self$`string`, "[a-z]/i")) { + invalid_fields["string"] <- "Invalid value for `string`, must conform to the pattern [a-z]/i." + } + + # check if the required `byte` is null + if (is.null(self$`byte`)) { + invalid_fields["byte"] <- "Non-nullable required field `byte` cannot be null." + } + + # check if the required `date` is null + if (is.null(self$`date`)) { + invalid_fields["date"] <- "Non-nullable required field `date` cannot be null." + } + + # check if the required `password` is null + if (is.null(self$`password`)) { + invalid_fields["password"] <- "Non-nullable required field `password` cannot be null." + } + + if (nchar(self$`password`) > 64) { + invalid_fields["password"] <- "Invalid length for `password`, must be smaller than or equal to 64." + } + if (nchar(self$`password`) < 10) { + invalid_fields["password"] <- "Invalid length for `password`, must be bigger than or equal to 10." + } + + if (!str_detect(self$`pattern_with_digits`, "^\\d{10}$")) { + invalid_fields["pattern_with_digits"] <- "Invalid value for `pattern_with_digits`, must conform to the pattern ^\\d{10}$." + } + + if (!str_detect(self$`pattern_with_digits_and_delimiter`, "^image_\\d{1,3}$/i")) { + invalid_fields["pattern_with_digits_and_delimiter"] <- "Invalid value for `pattern_with_digits_and_delimiter`, must conform to the pattern ^image_\\d{1,3}$/i." + } + + invalid_fields + }, + #' Print the object + #' + #' @description + #' Print the object + #' + #' @export + print = function() { + print(jsonlite::prettify(self$toJSONString())) + invisible(self) + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE +) +## Uncomment below to unlock the class to allow modifications of the method or field +# FormatTest$unlock() +# +## Below is an example to define the print fnuction +# FormatTest$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) +## Uncomment below to lock the class to prevent modifications to the method or field +# FormatTest$lock() + diff --git a/samples/client/petstore/R-httr2/R/model_api_response.R b/samples/client/petstore/R-httr2/R/model_api_response.R index de8760bdf23..0fd0c71e99c 100644 --- a/samples/client/petstore/R-httr2/R/model_api_response.R +++ b/samples/client/petstore/R-httr2/R/model_api_response.R @@ -31,15 +31,21 @@ ModelApiResponse <- R6::R6Class( #' @export initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, ...) { if (!is.null(`code`)) { - stopifnot(is.numeric(`code`), length(`code`) == 1) + if (!(is.numeric(`code`) && length(`code`) == 1)) { + stop(paste("Error! Invalid data for `code`. Must be an integer:", `code`)) + } self$`code` <- `code` } if (!is.null(`type`)) { - stopifnot(is.character(`type`), length(`type`) == 1) + if (!(is.character(`type`) && length(`type`) == 1)) { + stop(paste("Error! Invalid data for `type`. Must be a string:", `type`)) + } self$`type` <- `type` } if (!is.null(`message`)) { - stopifnot(is.character(`message`), length(`message`) == 1) + if (!(is.character(`message`) && length(`message`) == 1)) { + stop(paste("Error! Invalid data for `message`. Must be a string:", `message`)) + } self$`message` <- `message` } }, diff --git a/samples/client/petstore/R-httr2/R/nested_one_of.R b/samples/client/petstore/R-httr2/R/nested_one_of.R index 542a11c4d21..beef5124f9b 100644 --- a/samples/client/petstore/R-httr2/R/nested_one_of.R +++ b/samples/client/petstore/R-httr2/R/nested_one_of.R @@ -28,7 +28,9 @@ NestedOneOf <- R6::R6Class( #' @export initialize = function(`size` = NULL, `nested_pig` = NULL, ...) { if (!is.null(`size`)) { - stopifnot(is.numeric(`size`), length(`size`) == 1) + if (!(is.numeric(`size`) && length(`size`) == 1)) { + stop(paste("Error! Invalid data for `size`. Must be an integer:", `size`)) + } self$`size` <- `size` } if (!is.null(`nested_pig`)) { diff --git a/samples/client/petstore/R-httr2/R/order.R b/samples/client/petstore/R-httr2/R/order.R index 01b511bb351..b5604d99900 100644 --- a/samples/client/petstore/R-httr2/R/order.R +++ b/samples/client/petstore/R-httr2/R/order.R @@ -40,30 +40,42 @@ Order <- R6::R6Class( #' @export initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`petId`)) { - stopifnot(is.numeric(`petId`), length(`petId`) == 1) + if (!(is.numeric(`petId`) && length(`petId`) == 1)) { + stop(paste("Error! Invalid data for `petId`. Must be an integer:", `petId`)) + } self$`petId` <- `petId` } if (!is.null(`quantity`)) { - stopifnot(is.numeric(`quantity`), length(`quantity`) == 1) + if (!(is.numeric(`quantity`) && length(`quantity`) == 1)) { + stop(paste("Error! Invalid data for `quantity`. Must be an integer:", `quantity`)) + } self$`quantity` <- `quantity` } if (!is.null(`shipDate`)) { - stopifnot(is.character(`shipDate`), length(`shipDate`) == 1) + if (!is.character(`shipDate`)) { + stop(paste("Error! Invalid data for `shipDate`. Must be a string:", `shipDate`)) + } self$`shipDate` <- `shipDate` } if (!is.null(`status`)) { if (!(`status` %in% c("placed", "approved", "delivered"))) { stop(paste("Error! \"", `status`, "\" cannot be assigned to `status`. Must be \"placed\", \"approved\", \"delivered\".", sep = "")) } - stopifnot(is.character(`status`), length(`status`) == 1) + if (!(is.character(`status`) && length(`status`) == 1)) { + stop(paste("Error! Invalid data for `status`. Must be a string:", `status`)) + } self$`status` <- `status` } if (!is.null(`complete`)) { - stopifnot(is.logical(`complete`), length(`complete`) == 1) + if (!(is.logical(`complete`) && length(`complete`) == 1)) { + stop(paste("Error! Invalid data for `complete`. Must be a boolean:", `complete`)) + } self$`complete` <- `complete` } }, diff --git a/samples/client/petstore/R-httr2/R/pet.R b/samples/client/petstore/R-httr2/R/pet.R index f840c7ca9ab..be5b2767ef1 100644 --- a/samples/client/petstore/R-httr2/R/pet.R +++ b/samples/client/petstore/R-httr2/R/pet.R @@ -40,7 +40,9 @@ Pet <- R6::R6Class( #' @export initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, ...) { if (!missing(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } if (!missing(`photoUrls`)) { @@ -49,7 +51,9 @@ Pet <- R6::R6Class( self$`photoUrls` <- `photoUrls` } if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`category`)) { @@ -65,7 +69,9 @@ Pet <- R6::R6Class( if (!(`status` %in% c("available", "pending", "sold"))) { stop(paste("Error! \"", `status`, "\" cannot be assigned to `status`. Must be \"available\", \"pending\", \"sold\".", sep = "")) } - stopifnot(is.character(`status`), length(`status`) == 1) + if (!(is.character(`status`) && length(`status`) == 1)) { + stop(paste("Error! Invalid data for `status`. Must be a string:", `status`)) + } self$`status` <- `status` } }, @@ -232,7 +238,9 @@ Pet <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `name` if (!is.null(input_json$`name`)) { - stopifnot(is.character(input_json$`name`), length(input_json$`name`) == 1) + if (!(is.character(input_json$`name`) && length(input_json$`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", input_json$`name`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `name` is missing.")) } diff --git a/samples/client/petstore/R-httr2/R/pet_api.R b/samples/client/petstore/R-httr2/R/pet_api.R index 563895e44bf..77d3de45219 100644 --- a/samples/client/petstore/R-httr2/R/pet_api.R +++ b/samples/client/petstore/R-httr2/R/pet_api.R @@ -288,7 +288,7 @@ #' #################### add_pet #################### #' #' library(petstore) -#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store #' #' #Add a new pet to the store #' api_instance <- PetApi$new() @@ -326,7 +326,7 @@ #' #' library(petstore) #' var_pet_id <- 56 # integer | Pet id to delete -#' var_api_key <- "api_key_example" # character | +#' var_api_key <- "api_key_example" # character | (Optional) #' #' #Deletes a pet #' api_instance <- PetApi$new() @@ -354,7 +354,7 @@ #' #################### find_pets_by_status #################### #' #' library(petstore) -#' var_status <- ["status_example"] # array[character] | Status values that need to be considered for filter +#' var_status <- c("available") # array[character] | Status values that need to be considered for filter #' #' #Finds Pets by status #' api_instance <- PetApi$new() @@ -390,7 +390,7 @@ #' #################### find_pets_by_tags #################### #' #' library(petstore) -#' var_tags <- ["tags_example"] # array[character] | Tags to filter by +#' var_tags <- c("inner_example") # array[character] | Tags to filter by #' #' #Finds Pets by tags #' api_instance <- PetApi$new() @@ -537,7 +537,7 @@ #' #################### update_pet #################### #' #' library(petstore) -#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store #' #' #Update an existing pet #' api_instance <- PetApi$new() @@ -574,8 +574,8 @@ #' #' library(petstore) #' var_pet_id <- 56 # integer | ID of pet that needs to be updated -#' var_name <- "name_example" # character | Updated name of the pet -#' var_status <- "status_example" # character | Updated status of the pet +#' var_name <- "name_example" # character | Updated name of the pet (Optional) +#' var_status <- "status_example" # character | Updated status of the pet (Optional) #' #' #Updates a pet in the store with form data #' api_instance <- PetApi$new() @@ -601,8 +601,8 @@ #' #' library(petstore) #' var_pet_id <- 56 # integer | ID of pet to update -#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server -#' var_file <- File.new('/path/to/file') # data.frame | file to upload +#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional) +#' var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional) #' #' #uploads an image #' api_instance <- PetApi$new() diff --git a/samples/client/petstore/R-httr2/R/special.R b/samples/client/petstore/R-httr2/R/special.R index 32ced477530..e2089142e9d 100644 --- a/samples/client/petstore/R-httr2/R/special.R +++ b/samples/client/petstore/R-httr2/R/special.R @@ -51,27 +51,39 @@ Special <- R6::R6Class( self$`set_test` <- `set_test` } if (!is.null(`item_self`)) { - stopifnot(is.numeric(`item_self`), length(`item_self`) == 1) + if (!(is.numeric(`item_self`) && length(`item_self`) == 1)) { + stop(paste("Error! Invalid data for `item_self`. Must be an integer:", `item_self`)) + } self$`item_self` <- `item_self` } if (!is.null(`item_private`)) { - stopifnot(is.character(`item_private`), length(`item_private`) == 1) + if (!(is.character(`item_private`) && length(`item_private`) == 1)) { + stop(paste("Error! Invalid data for `item_private`. Must be a string:", `item_private`)) + } self$`item_private` <- `item_private` } if (!is.null(`item_super`)) { - stopifnot(is.character(`item_super`), length(`item_super`) == 1) + if (!(is.character(`item_super`) && length(`item_super`) == 1)) { + stop(paste("Error! Invalid data for `item_super`. Must be a string:", `item_super`)) + } self$`item_super` <- `item_super` } if (!is.null(`123_number`)) { - stopifnot(is.character(`123_number`), length(`123_number`) == 1) + if (!(is.character(`123_number`) && length(`123_number`) == 1)) { + stop(paste("Error! Invalid data for `123_number`. Must be a string:", `123_number`)) + } self$`123_number` <- `123_number` } if (!is.null(`array[test]`)) { - stopifnot(is.character(`array[test]`), length(`array[test]`) == 1) + if (!(is.character(`array[test]`) && length(`array[test]`) == 1)) { + stop(paste("Error! Invalid data for `array[test]`. Must be a string:", `array[test]`)) + } self$`array[test]` <- `array[test]` } if (!is.null(`empty_string`)) { - stopifnot(is.character(`empty_string`), length(`empty_string`) == 1) + if (!(is.character(`empty_string`) && length(`empty_string`) == 1)) { + stop(paste("Error! Invalid data for `empty_string`. Must be a string:", `empty_string`)) + } self$`empty_string` <- `empty_string` } }, diff --git a/samples/client/petstore/R-httr2/R/store_api.R b/samples/client/petstore/R-httr2/R/store_api.R index ef974aa9a56..b5941c11d85 100644 --- a/samples/client/petstore/R-httr2/R/store_api.R +++ b/samples/client/petstore/R-httr2/R/store_api.R @@ -211,7 +211,7 @@ #' #################### place_order #################### #' #' library(petstore) -#' var_order <- Order$new() # Order | order placed for purchasing the pet +#' var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet #' #' #Place an order for a pet #' api_instance <- StoreApi$new() diff --git a/samples/client/petstore/R-httr2/R/tag.R b/samples/client/petstore/R-httr2/R/tag.R index 8db55133014..51603e72ab3 100644 --- a/samples/client/petstore/R-httr2/R/tag.R +++ b/samples/client/petstore/R-httr2/R/tag.R @@ -28,11 +28,15 @@ Tag <- R6::R6Class( #' @export initialize = function(`id` = NULL, `name` = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } }, diff --git a/samples/client/petstore/R-httr2/R/user.R b/samples/client/petstore/R-httr2/R/user.R index c3db6eb00d7..78896afef3c 100644 --- a/samples/client/petstore/R-httr2/R/user.R +++ b/samples/client/petstore/R-httr2/R/user.R @@ -46,35 +46,51 @@ User <- R6::R6Class( #' @export initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`username`)) { - stopifnot(is.character(`username`), length(`username`) == 1) + if (!(is.character(`username`) && length(`username`) == 1)) { + stop(paste("Error! Invalid data for `username`. Must be a string:", `username`)) + } self$`username` <- `username` } if (!is.null(`firstName`)) { - stopifnot(is.character(`firstName`), length(`firstName`) == 1) + if (!(is.character(`firstName`) && length(`firstName`) == 1)) { + stop(paste("Error! Invalid data for `firstName`. Must be a string:", `firstName`)) + } self$`firstName` <- `firstName` } if (!is.null(`lastName`)) { - stopifnot(is.character(`lastName`), length(`lastName`) == 1) + if (!(is.character(`lastName`) && length(`lastName`) == 1)) { + stop(paste("Error! Invalid data for `lastName`. Must be a string:", `lastName`)) + } self$`lastName` <- `lastName` } if (!is.null(`email`)) { - stopifnot(is.character(`email`), length(`email`) == 1) + if (!(is.character(`email`) && length(`email`) == 1)) { + stop(paste("Error! Invalid data for `email`. Must be a string:", `email`)) + } self$`email` <- `email` } if (!is.null(`password`)) { - stopifnot(is.character(`password`), length(`password`) == 1) + if (!(is.character(`password`) && length(`password`) == 1)) { + stop(paste("Error! Invalid data for `password`. Must be a string:", `password`)) + } self$`password` <- `password` } if (!is.null(`phone`)) { - stopifnot(is.character(`phone`), length(`phone`) == 1) + if (!(is.character(`phone`) && length(`phone`) == 1)) { + stop(paste("Error! Invalid data for `phone`. Must be a string:", `phone`)) + } self$`phone` <- `phone` } if (!is.null(`userStatus`)) { - stopifnot(is.numeric(`userStatus`), length(`userStatus`) == 1) + if (!(is.numeric(`userStatus`) && length(`userStatus`) == 1)) { + stop(paste("Error! Invalid data for `userStatus`. Must be an integer:", `userStatus`)) + } self$`userStatus` <- `userStatus` } }, diff --git a/samples/client/petstore/R-httr2/R/user_api.R b/samples/client/petstore/R-httr2/R/user_api.R index 379460748f0..50c752bd7e6 100644 --- a/samples/client/petstore/R-httr2/R/user_api.R +++ b/samples/client/petstore/R-httr2/R/user_api.R @@ -197,7 +197,7 @@ #' #################### create_user #################### #' #' library(petstore) -#' var_user <- User$new() # User | Created user object +#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object #' #' #Create user #' api_instance <- UserApi$new() @@ -225,7 +225,7 @@ #' #################### create_users_with_array_input #################### #' #' library(petstore) -#' var_user <- [User$new()] # array[User] | List of user object +#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object #' #' #Creates list of users with given input array #' api_instance <- UserApi$new() @@ -253,7 +253,7 @@ #' #################### create_users_with_list_input #################### #' #' library(petstore) -#' var_user <- [User$new()] # array[User] | List of user object +#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object #' #' #Creates list of users with given input array #' api_instance <- UserApi$new() @@ -404,7 +404,7 @@ #' #' library(petstore) #' var_username <- "username_example" # character | name that need to be deleted -#' var_user <- User$new() # User | Updated user object +#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object #' #' #Updated user #' api_instance <- UserApi$new() diff --git a/samples/client/petstore/R-httr2/R/whale.R b/samples/client/petstore/R-httr2/R/whale.R index 51a3f0b69f2..084df84385a 100644 --- a/samples/client/petstore/R-httr2/R/whale.R +++ b/samples/client/petstore/R-httr2/R/whale.R @@ -31,15 +31,21 @@ Whale <- R6::R6Class( #' @export initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`hasBaleen`)) { - stopifnot(is.logical(`hasBaleen`), length(`hasBaleen`) == 1) + if (!(is.logical(`hasBaleen`) && length(`hasBaleen`) == 1)) { + stop(paste("Error! Invalid data for `hasBaleen`. Must be a boolean:", `hasBaleen`)) + } self$`hasBaleen` <- `hasBaleen` } if (!is.null(`hasTeeth`)) { - stopifnot(is.logical(`hasTeeth`), length(`hasTeeth`) == 1) + if (!(is.logical(`hasTeeth`) && length(`hasTeeth`) == 1)) { + stop(paste("Error! Invalid data for `hasTeeth`. Must be a boolean:", `hasTeeth`)) + } self$`hasTeeth` <- `hasTeeth` } }, @@ -150,7 +156,9 @@ Whale <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Whale: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R-httr2/R/zebra.R b/samples/client/petstore/R-httr2/R/zebra.R index 7feafc3745c..0a1aa587e11 100644 --- a/samples/client/petstore/R-httr2/R/zebra.R +++ b/samples/client/petstore/R-httr2/R/zebra.R @@ -28,14 +28,18 @@ Zebra <- R6::R6Class( #' @export initialize = function(`className`, `type` = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`type`)) { if (!(`type` %in% c("plains", "mountain", "grevys"))) { stop(paste("Error! \"", `type`, "\" cannot be assigned to `type`. Must be \"plains\", \"mountain\", \"grevys\".", sep = "")) } - stopifnot(is.character(`type`), length(`type`) == 1) + if (!(is.character(`type`) && length(`type`) == 1)) { + stop(paste("Error! Invalid data for `type`. Must be a string:", `type`)) + } self$`type` <- `type` } }, @@ -136,7 +140,9 @@ Zebra <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Zebra: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R-httr2/README.md b/samples/client/petstore/R-httr2/README.md index bb481451cbd..12e7b2a7aac 100644 --- a/samples/client/petstore/R-httr2/README.md +++ b/samples/client/petstore/R-httr2/README.md @@ -115,6 +115,7 @@ Class | Method | HTTP request | Description - [Date](docs/Date.md) - [Dog](docs/Dog.md) - [DogAllOf](docs/DogAllOf.md) + - [FormatTest](docs/FormatTest.md) - [Mammal](docs/Mammal.md) - [ModelApiResponse](docs/ModelApiResponse.md) - [NestedOneOf](docs/NestedOneOf.md) diff --git a/samples/client/petstore/R-httr2/docs/FakeApi.md b/samples/client/petstore/R-httr2/docs/FakeApi.md index 0c5e8a0af97..a6a30c06e09 100644 --- a/samples/client/petstore/R-httr2/docs/FakeApi.md +++ b/samples/client/petstore/R-httr2/docs/FakeApi.md @@ -25,7 +25,7 @@ library(petstore) # Add a new pet to the store (optional body) # # prepare function argument(s) -var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional) +var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional) api_instance <- FakeApi$new() # Configure HTTP basic authorization: http_auth @@ -153,7 +153,7 @@ library(petstore) # test array parameter in path # # prepare function argument(s) -var_path_array <- list("inner_example") # array[character] | dummy path parameter +var_path_array <- c("inner_example") # array[character] | dummy path parameter api_instance <- FakeApi$new() result <- tryCatch( @@ -263,8 +263,8 @@ library(petstore) # test set query parameter # # prepare function argument(s) -var_set_dummy <- list("inner_example") # set[character] | set query -var_array_dummy <- list("inner_example") # array[character] | array query +var_set_dummy <- c("inner_example") # set[character] | set query +var_array_dummy <- c("inner_example") # array[character] | array query api_instance <- FakeApi$new() result <- tryCatch( diff --git a/samples/client/petstore/R-httr2/docs/FormatTest.md b/samples/client/petstore/R-httr2/docs/FormatTest.md new file mode 100644 index 00000000000..1d483f62704 --- /dev/null +++ b/samples/client/petstore/R-httr2/docs/FormatTest.md @@ -0,0 +1,23 @@ +# petstore::FormatTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **integer** | | [optional] [Max: 100] [Min: 10] +**int32** | **integer** | | [optional] [Max: 200] [Min: 20] +**int64** | **integer** | | [optional] +**number** | **numeric** | | [Max: 543.2] [Min: 32.1] +**float** | **numeric** | | [optional] [Max: 987.6] [Min: 54.3] +**double** | **numeric** | | [optional] [Max: 123.4] [Min: 67.8] +**string** | **character** | | [optional] [Pattern: [a-z]/i] +**byte** | **character** | | +**binary** | **data.frame** | | [optional] +**date** | **character** | | [default to "Fri Jul 19 00:00:00 UTC 2019"] +**dateTime** | **character** | | [optional] [default to "2015-10-28T14:38:02Z"] +**uuid** | **character** | | [optional] +**password** | **character** | | [Max. length: 64] [Min. length: 10] +**pattern_with_digits** | **character** | A string that is a 10 digit number. Can have leading zeros. | [optional] [Pattern: ^\\d{10}$] +**pattern_with_digits_and_delimiter** | **character** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [Pattern: ^image_\\d{1,3}$/i] + + diff --git a/samples/client/petstore/R-httr2/docs/PetApi.md b/samples/client/petstore/R-httr2/docs/PetApi.md index 26936a4b787..d33dc0b9357 100644 --- a/samples/client/petstore/R-httr2/docs/PetApi.md +++ b/samples/client/petstore/R-httr2/docs/PetApi.md @@ -30,7 +30,7 @@ library(petstore) # Add a new pet to the store # # prepare function argument(s) -var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store +var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store api_instance <- PetApi$new() # Configure HTTP basic authorization: http_auth @@ -154,7 +154,7 @@ library(petstore) # Finds Pets by status # # prepare function argument(s) -var_status <- list("available") # array[character] | Status values that need to be considered for filter +var_status <- c("available") # array[character] | Status values that need to be considered for filter api_instance <- PetApi$new() # Configure OAuth2 access token for authorization: petstore_auth @@ -218,7 +218,7 @@ library(petstore) # Finds Pets by tags # # prepare function argument(s) -var_tags <- list("inner_example") # array[character] | Tags to filter by +var_tags <- c("inner_example") # array[character] | Tags to filter by api_instance <- PetApi$new() result <- tryCatch( @@ -479,7 +479,7 @@ library(petstore) # Update an existing pet # # prepare function argument(s) -var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store +var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store api_instance <- PetApi$new() # Configure OAuth2 access token for authorization: petstore_auth diff --git a/samples/client/petstore/R-httr2/docs/UserApi.md b/samples/client/petstore/R-httr2/docs/UserApi.md index 7bb012fd1b4..ed7ddfbc35e 100644 --- a/samples/client/petstore/R-httr2/docs/UserApi.md +++ b/samples/client/petstore/R-httr2/docs/UserApi.md @@ -85,7 +85,7 @@ library(petstore) # Creates list of users with given input array # # prepare function argument(s) -var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object +var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object api_instance <- UserApi$new() # Configure API key authorization: api_key @@ -142,7 +142,7 @@ library(petstore) # Creates list of users with given input array # # prepare function argument(s) -var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object +var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object api_instance <- UserApi$new() # Configure API key authorization: api_key diff --git a/samples/client/petstore/R-httr2/tests/testthat/test_format_test.R b/samples/client/petstore/R-httr2/tests/testthat/test_format_test.R new file mode 100644 index 00000000000..47963949104 --- /dev/null +++ b/samples/client/petstore/R-httr2/tests/testthat/test_format_test.R @@ -0,0 +1,113 @@ +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate + +context("Test FormatTest") + +model_instance <- FormatTest$new() + +test_that("integer", { + # tests for the property `integer` (integer) + + # uncomment below to test the property + #expect_equal(model.instance$`integer`, "EXPECTED_RESULT") +}) + +test_that("int32", { + # tests for the property `int32` (integer) + + # uncomment below to test the property + #expect_equal(model.instance$`int32`, "EXPECTED_RESULT") +}) + +test_that("int64", { + # tests for the property `int64` (integer) + + # uncomment below to test the property + #expect_equal(model.instance$`int64`, "EXPECTED_RESULT") +}) + +test_that("number", { + # tests for the property `number` (numeric) + + # uncomment below to test the property + #expect_equal(model.instance$`number`, "EXPECTED_RESULT") +}) + +test_that("float", { + # tests for the property `float` (numeric) + + # uncomment below to test the property + #expect_equal(model.instance$`float`, "EXPECTED_RESULT") +}) + +test_that("double", { + # tests for the property `double` (numeric) + + # uncomment below to test the property + #expect_equal(model.instance$`double`, "EXPECTED_RESULT") +}) + +test_that("string", { + # tests for the property `string` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`string`, "EXPECTED_RESULT") +}) + +test_that("byte", { + # tests for the property `byte` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`byte`, "EXPECTED_RESULT") +}) + +test_that("binary", { + # tests for the property `binary` (data.frame) + + # uncomment below to test the property + #expect_equal(model.instance$`binary`, "EXPECTED_RESULT") +}) + +test_that("date", { + # tests for the property `date` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`date`, "EXPECTED_RESULT") +}) + +test_that("dateTime", { + # tests for the property `dateTime` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`dateTime`, "EXPECTED_RESULT") +}) + +test_that("uuid", { + # tests for the property `uuid` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`uuid`, "EXPECTED_RESULT") +}) + +test_that("password", { + # tests for the property `password` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`password`, "EXPECTED_RESULT") +}) + +test_that("pattern_with_digits", { + # tests for the property `pattern_with_digits` (character) + # A string that is a 10 digit number. Can have leading zeros. + + # uncomment below to test the property + #expect_equal(model.instance$`pattern_with_digits`, "EXPECTED_RESULT") +}) + +test_that("pattern_with_digits_and_delimiter", { + # tests for the property `pattern_with_digits_and_delimiter` (character) + # A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + + # uncomment below to test the property + #expect_equal(model.instance$`pattern_with_digits_and_delimiter`, "EXPECTED_RESULT") +}) diff --git a/samples/client/petstore/R/.openapi-generator/FILES b/samples/client/petstore/R/.openapi-generator/FILES index d539ea462da..766a7cea2d5 100644 --- a/samples/client/petstore/R/.openapi-generator/FILES +++ b/samples/client/petstore/R/.openapi-generator/FILES @@ -21,6 +21,7 @@ R/date.R R/dog.R R/dog_all_of.R R/fake_api.R +R/format_test.R R/mammal.R R/model_api_response.R R/nested_one_of.R @@ -51,6 +52,7 @@ docs/Date.md docs/Dog.md docs/DogAllOf.md docs/FakeApi.md +docs/FormatTest.md docs/Mammal.md docs/ModelApiResponse.md docs/NestedOneOf.md diff --git a/samples/client/petstore/R/NAMESPACE b/samples/client/petstore/R/NAMESPACE index a38534972b8..b1057393be9 100644 --- a/samples/client/petstore/R/NAMESPACE +++ b/samples/client/petstore/R/NAMESPACE @@ -26,6 +26,7 @@ export(DanishPig) export(Date) export(Dog) export(DogAllOf) +export(FormatTest) export(Mammal) export(ModelApiResponse) export(NestedOneOf) diff --git a/samples/client/petstore/R/R/allof_tag_api_response.R b/samples/client/petstore/R/R/allof_tag_api_response.R index e485c15e4ca..220d89ee503 100644 --- a/samples/client/petstore/R/R/allof_tag_api_response.R +++ b/samples/client/petstore/R/R/allof_tag_api_response.R @@ -42,23 +42,33 @@ AllofTagApiResponse <- R6::R6Class( #' @export initialize = function(`id` = NULL, `name` = NULL, `code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } if (!is.null(`code`)) { - stopifnot(is.numeric(`code`), length(`code`) == 1) + if (!(is.numeric(`code`) && length(`code`) == 1)) { + stop(paste("Error! Invalid data for `code`. Must be an integer:", `code`)) + } self$`code` <- `code` } if (!is.null(`type`)) { - stopifnot(is.character(`type`), length(`type`) == 1) + if (!(is.character(`type`) && length(`type`) == 1)) { + stop(paste("Error! Invalid data for `type`. Must be a string:", `type`)) + } self$`type` <- `type` } if (!is.null(`message`)) { - stopifnot(is.character(`message`), length(`message`) == 1) + if (!(is.character(`message`) && length(`message`) == 1)) { + stop(paste("Error! Invalid data for `message`. Must be a string:", `message`)) + } self$`message` <- `message` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R/R/animal.R b/samples/client/petstore/R/R/animal.R index 632b160087d..b506bced42f 100644 --- a/samples/client/petstore/R/R/animal.R +++ b/samples/client/petstore/R/R/animal.R @@ -35,11 +35,15 @@ Animal <- R6::R6Class( #' @export initialize = function(`className`, `color` = "red", additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } if (!is.null(additional_properties)) { @@ -162,7 +166,9 @@ Animal <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R/R/basque_pig.R b/samples/client/petstore/R/R/basque_pig.R index 2335bbe37c0..ac83042c8cf 100644 --- a/samples/client/petstore/R/R/basque_pig.R +++ b/samples/client/petstore/R/R/basque_pig.R @@ -33,11 +33,15 @@ BasquePig <- R6::R6Class( #' @export initialize = function(`className`, `color`, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!missing(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } if (!is.null(additional_properties)) { @@ -160,13 +164,17 @@ BasquePig <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `className` is missing.")) } # check the required field `color` if (!is.null(input_json$`color`)) { - stopifnot(is.character(input_json$`color`), length(input_json$`color`) == 1) + if (!(is.character(input_json$`color`) && length(input_json$`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", input_json$`color`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing.")) } diff --git a/samples/client/petstore/R/R/cat.R b/samples/client/petstore/R/R/cat.R index 60d417950b1..f74e2d887dd 100644 --- a/samples/client/petstore/R/R/cat.R +++ b/samples/client/petstore/R/R/cat.R @@ -37,15 +37,21 @@ Cat <- R6::R6Class( #' @export initialize = function(`className`, `color` = "red", `declawed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } if (!is.null(`declawed`)) { - stopifnot(is.logical(`declawed`), length(`declawed`) == 1) + if (!(is.logical(`declawed`) && length(`declawed`) == 1)) { + stop(paste("Error! Invalid data for `declawed`. Must be a boolean:", `declawed`)) + } self$`declawed` <- `declawed` } if (!is.null(additional_properties)) { @@ -184,7 +190,9 @@ Cat <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Cat: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R/R/cat_all_of.R b/samples/client/petstore/R/R/cat_all_of.R index c3969fc0550..197e1a46e3a 100644 --- a/samples/client/petstore/R/R/cat_all_of.R +++ b/samples/client/petstore/R/R/cat_all_of.R @@ -30,7 +30,9 @@ CatAllOf <- R6::R6Class( #' @export initialize = function(`declawed` = NULL, additional_properties = NULL, ...) { if (!is.null(`declawed`)) { - stopifnot(is.logical(`declawed`), length(`declawed`) == 1) + if (!(is.logical(`declawed`) && length(`declawed`) == 1)) { + stop(paste("Error! Invalid data for `declawed`. Must be a boolean:", `declawed`)) + } self$`declawed` <- `declawed` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R/R/category.R b/samples/client/petstore/R/R/category.R index 2de263a5682..2646d01bd72 100644 --- a/samples/client/petstore/R/R/category.R +++ b/samples/client/petstore/R/R/category.R @@ -33,11 +33,15 @@ Category <- R6::R6Class( #' @export initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R/R/danish_pig.R b/samples/client/petstore/R/R/danish_pig.R index 737bfad4b97..06cf5096a88 100644 --- a/samples/client/petstore/R/R/danish_pig.R +++ b/samples/client/petstore/R/R/danish_pig.R @@ -33,11 +33,15 @@ DanishPig <- R6::R6Class( #' @export initialize = function(`className`, `size`, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!missing(`size`)) { - stopifnot(is.numeric(`size`), length(`size`) == 1) + if (!(is.numeric(`size`) && length(`size`) == 1)) { + stop(paste("Error! Invalid data for `size`. Must be an integer:", `size`)) + } self$`size` <- `size` } if (!is.null(additional_properties)) { @@ -160,13 +164,17 @@ DanishPig <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `className` is missing.")) } # check the required field `size` if (!is.null(input_json$`size`)) { - stopifnot(is.numeric(input_json$`size`), length(input_json$`size`) == 1) + if (!(is.numeric(input_json$`size`) && length(input_json$`size`) == 1)) { + stop(paste("Error! Invalid data for `size`. Must be an integer:", input_json$`size`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `size` is missing.")) } diff --git a/samples/client/petstore/R/R/date.R b/samples/client/petstore/R/R/date.R index a26b7977d4f..79945bc8cfc 100644 --- a/samples/client/petstore/R/R/date.R +++ b/samples/client/petstore/R/R/date.R @@ -36,19 +36,25 @@ Date <- R6::R6Class( #' @export initialize = function(`className`, `url_property`, `percent_description` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!missing(`url_property`)) { - stopifnot(is.character(`url_property`), length(`url_property`) == 1) + if (!(is.character(`url_property`) && length(`url_property`) == 1)) { + stop(paste("Error! Invalid data for `url_property`. Must be a string:", `url_property`)) + } # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", `url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", `url_property`)) } self$`url_property` <- `url_property` } if (!is.null(`percent_description`)) { - stopifnot(is.character(`percent_description`), length(`percent_description`) == 1) + if (!(is.character(`percent_description`) && length(`percent_description`) == 1)) { + stop(paste("Error! Invalid data for `percent_description`. Must be a string:", `percent_description`)) + } self$`percent_description` <- `percent_description` } if (!is.null(additional_properties)) { @@ -103,7 +109,7 @@ Date <- R6::R6Class( if (!is.null(this_object$`url_property`)) { # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(this_object$`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", this_object$`url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", this_object$`url_property`)) } self$`url_property` <- this_object$`url_property` } @@ -172,7 +178,7 @@ Date <- R6::R6Class( self$`percent_description` <- this_object$`percent_description` # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(this_object$`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", this_object$`url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", this_object$`url_property`)) } self$`url_property` <- this_object$`url_property` # process additional properties/fields in the payload @@ -195,16 +201,20 @@ Date <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Date: the required field `className` is missing.")) } # check the required field `url_property` if (!is.null(input_json$`url_property`)) { - stopifnot(is.character(input_json$`url_property`), length(input_json$`url_property`) == 1) + if (!(is.character(input_json$`url_property`) && length(input_json$`url_property`) == 1)) { + stop(paste("Error! Invalid data for `url_property`. Must be a string:", input_json$`url_property`)) + } # to validate URL. ref: https://stackoverflow.com/questions/73952024/url-validation-in-r if (!stringr::str_detect(input_json$`url_property`, "(https?|ftp)://[^ /$.?#].[^\\s]*")) { - stop(paste("Error! Invalid URL:", input_json$`url_property`)) + stop(paste("Error! Invalid data for `url_property`. Must be a URL:", input_json$`url_property`)) } } else { stop(paste("The JSON input `", input, "` is invalid for Date: the required field `url_property` is missing.")) diff --git a/samples/client/petstore/R/R/dog.R b/samples/client/petstore/R/R/dog.R index 67fb8a315e2..a814c57d586 100644 --- a/samples/client/petstore/R/R/dog.R +++ b/samples/client/petstore/R/R/dog.R @@ -37,15 +37,21 @@ Dog <- R6::R6Class( #' @export initialize = function(`className`, `color` = "red", `breed` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`color`)) { - stopifnot(is.character(`color`), length(`color`) == 1) + if (!(is.character(`color`) && length(`color`) == 1)) { + stop(paste("Error! Invalid data for `color`. Must be a string:", `color`)) + } self$`color` <- `color` } if (!is.null(`breed`)) { - stopifnot(is.character(`breed`), length(`breed`) == 1) + if (!(is.character(`breed`) && length(`breed`) == 1)) { + stop(paste("Error! Invalid data for `breed`. Must be a string:", `breed`)) + } self$`breed` <- `breed` } if (!is.null(additional_properties)) { @@ -184,7 +190,9 @@ Dog <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Dog: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R/R/dog_all_of.R b/samples/client/petstore/R/R/dog_all_of.R index ea44d583d74..17608478eed 100644 --- a/samples/client/petstore/R/R/dog_all_of.R +++ b/samples/client/petstore/R/R/dog_all_of.R @@ -30,7 +30,9 @@ DogAllOf <- R6::R6Class( #' @export initialize = function(`breed` = NULL, additional_properties = NULL, ...) { if (!is.null(`breed`)) { - stopifnot(is.character(`breed`), length(`breed`) == 1) + if (!(is.character(`breed`) && length(`breed`) == 1)) { + stop(paste("Error! Invalid data for `breed`. Must be a string:", `breed`)) + } self$`breed` <- `breed` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R/R/fake_api.R b/samples/client/petstore/R/R/fake_api.R index b20d9bcd7f5..dd909ca79ad 100644 --- a/samples/client/petstore/R/R/fake_api.R +++ b/samples/client/petstore/R/R/fake_api.R @@ -117,7 +117,7 @@ #' #################### AddPetOptional #################### #' #' library(petstore) -#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional) #' #' #Add a new pet to the store (optional body) #' api_instance <- FakeApi$new() @@ -155,7 +155,7 @@ #' #' library(petstore) #' var_dummy <- "dummy_example" # character | dummy required parameter -#' var_var_data_file <- "var_data_file_example" # character | header data file +#' var_var_data_file <- "var_data_file_example" # character | header data file (Optional) #' #' #test data_file to ensure it's escaped correctly #' api_instance <- FakeApi$new() @@ -188,7 +188,7 @@ #' #################### FakePathArray #################### #' #' library(petstore) -#' var_path_array <- ["path_array_example"] # array[character] | dummy path parameter +#' var_path_array <- c("inner_example") # array[character] | dummy path parameter #' #' #test array parameter in path #' api_instance <- FakeApi$new() @@ -238,8 +238,8 @@ #' #################### FakeSetQuery #################### #' #' library(petstore) -#' var_set_dummy <- ["set_dummy_example"] # set[character] | set query -#' var_array_dummy <- ["array_dummy_example"] # array[character] | array query +#' var_set_dummy <- c("inner_example") # set[character] | set query +#' var_array_dummy <- c("inner_example") # array[character] | array query #' #' #test set query parameter #' api_instance <- FakeApi$new() diff --git a/samples/client/petstore/R/R/format_test.R b/samples/client/petstore/R/R/format_test.R new file mode 100644 index 00000000000..4bd74e3a727 --- /dev/null +++ b/samples/client/petstore/R/R/format_test.R @@ -0,0 +1,711 @@ +#' Create a new FormatTest +#' +#' @description +#' FormatTest Class +#' +#' @docType class +#' @title FormatTest +#' @description FormatTest Class +#' @format An \code{R6Class} generator object +#' @field integer integer [optional] +#' @field int32 integer [optional] +#' @field int64 integer [optional] +#' @field number numeric +#' @field float numeric [optional] +#' @field double numeric [optional] +#' @field string character [optional] +#' @field byte character +#' @field binary data.frame [optional] +#' @field date character +#' @field dateTime character [optional] +#' @field uuid character [optional] +#' @field password character +#' @field pattern_with_digits A string that is a 10 digit number. Can have leading zeros. character [optional] +#' @field pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. character [optional] +#' @field _field_list a list of fields list(character) +#' @field additional_properties additional properties list(character) [optional] +#' @importFrom R6 R6Class +#' @importFrom jsonlite fromJSON toJSON +#' @export +FormatTest <- R6::R6Class( + "FormatTest", + public = list( + `integer` = NULL, + `int32` = NULL, + `int64` = NULL, + `number` = NULL, + `float` = NULL, + `double` = NULL, + `string` = NULL, + `byte` = NULL, + `binary` = NULL, + `date` = NULL, + `dateTime` = NULL, + `uuid` = NULL, + `password` = NULL, + `pattern_with_digits` = NULL, + `pattern_with_digits_and_delimiter` = NULL, + `_field_list` = c("integer", "int32", "int64", "number", "float", "double", "string", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"), + `additional_properties` = list(), + #' Initialize a new FormatTest class. + #' + #' @description + #' Initialize a new FormatTest class. + #' + #' @param number number + #' @param byte byte + #' @param date date + #' @param password password + #' @param integer integer + #' @param int32 int32 + #' @param int64 int64 + #' @param float float + #' @param double double + #' @param string string + #' @param binary binary + #' @param dateTime dateTime. Default to "2015-10-28T14:38:02Z". + #' @param uuid uuid + #' @param pattern_with_digits A string that is a 10 digit number. Can have leading zeros. + #' @param pattern_with_digits_and_delimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + #' @param additional_properties additonal properties (optional) + #' @param ... Other optional arguments. + #' @export + initialize = function(`number`, `byte`, `date`, `password`, `integer` = NULL, `int32` = NULL, `int64` = NULL, `float` = NULL, `double` = NULL, `string` = NULL, `binary` = NULL, `dateTime` = "2015-10-28T14:38:02Z", `uuid` = NULL, `pattern_with_digits` = NULL, `pattern_with_digits_and_delimiter` = NULL, additional_properties = NULL, ...) { + if (!missing(`number`)) { + self$`number` <- `number` + } + if (!missing(`byte`)) { + self$`byte` <- `byte` + } + if (!missing(`date`)) { + if (!(is.character(`date`) && length(`date`) == 1)) { + stop(paste("Error! Invalid data for `date`. Must be a string:", `date`)) + } + self$`date` <- `date` + } + if (!missing(`password`)) { + if (!(is.character(`password`) && length(`password`) == 1)) { + stop(paste("Error! Invalid data for `password`. Must be a string:", `password`)) + } + self$`password` <- `password` + } + if (!is.null(`integer`)) { + if (!(is.numeric(`integer`) && length(`integer`) == 1)) { + stop(paste("Error! Invalid data for `integer`. Must be an integer:", `integer`)) + } + self$`integer` <- `integer` + } + if (!is.null(`int32`)) { + if (!(is.numeric(`int32`) && length(`int32`) == 1)) { + stop(paste("Error! Invalid data for `int32`. Must be an integer:", `int32`)) + } + self$`int32` <- `int32` + } + if (!is.null(`int64`)) { + if (!(is.numeric(`int64`) && length(`int64`) == 1)) { + stop(paste("Error! Invalid data for `int64`. Must be an integer:", `int64`)) + } + self$`int64` <- `int64` + } + if (!is.null(`float`)) { + if (!(is.numeric(`float`) && length(`float`) == 1)) { + stop(paste("Error! Invalid data for `float`. Must be a number:", `float`)) + } + self$`float` <- `float` + } + if (!is.null(`double`)) { + if (!(is.numeric(`double`) && length(`double`) == 1)) { + stop(paste("Error! Invalid data for `double`. Must be a number:", `double`)) + } + self$`double` <- `double` + } + if (!is.null(`string`)) { + if (!(is.character(`string`) && length(`string`) == 1)) { + stop(paste("Error! Invalid data for `string`. Must be a string:", `string`)) + } + self$`string` <- `string` + } + if (!is.null(`binary`)) { + self$`binary` <- `binary` + } + if (!is.null(`dateTime`)) { + if (!is.character(`dateTime`)) { + stop(paste("Error! Invalid data for `dateTime`. Must be a string:", `dateTime`)) + } + self$`dateTime` <- `dateTime` + } + if (!is.null(`uuid`)) { + if (!(is.character(`uuid`) && length(`uuid`) == 1)) { + stop(paste("Error! Invalid data for `uuid`. Must be a string:", `uuid`)) + } + self$`uuid` <- `uuid` + } + if (!is.null(`pattern_with_digits`)) { + if (!(is.character(`pattern_with_digits`) && length(`pattern_with_digits`) == 1)) { + stop(paste("Error! Invalid data for `pattern_with_digits`. Must be a string:", `pattern_with_digits`)) + } + self$`pattern_with_digits` <- `pattern_with_digits` + } + if (!is.null(`pattern_with_digits_and_delimiter`)) { + if (!(is.character(`pattern_with_digits_and_delimiter`) && length(`pattern_with_digits_and_delimiter`) == 1)) { + stop(paste("Error! Invalid data for `pattern_with_digits_and_delimiter`. Must be a string:", `pattern_with_digits_and_delimiter`)) + } + self$`pattern_with_digits_and_delimiter` <- `pattern_with_digits_and_delimiter` + } + if (!is.null(additional_properties)) { + for (key in names(additional_properties)) { + self$additional_properties[[key]] <- additional_properties[[key]] + } + } + }, + #' To JSON string + #' + #' @description + #' To JSON String + #' + #' @return FormatTest in JSON format + #' @export + toJSON = function() { + FormatTestObject <- list() + if (!is.null(self$`integer`)) { + FormatTestObject[["integer"]] <- + self$`integer` + } + if (!is.null(self$`int32`)) { + FormatTestObject[["int32"]] <- + self$`int32` + } + if (!is.null(self$`int64`)) { + FormatTestObject[["int64"]] <- + self$`int64` + } + if (!is.null(self$`number`)) { + FormatTestObject[["number"]] <- + self$`number` + } + if (!is.null(self$`float`)) { + FormatTestObject[["float"]] <- + self$`float` + } + if (!is.null(self$`double`)) { + FormatTestObject[["double"]] <- + self$`double` + } + if (!is.null(self$`string`)) { + FormatTestObject[["string"]] <- + self$`string` + } + if (!is.null(self$`byte`)) { + FormatTestObject[["byte"]] <- + self$`byte` + } + if (!is.null(self$`binary`)) { + FormatTestObject[["binary"]] <- + self$`binary` + } + if (!is.null(self$`date`)) { + FormatTestObject[["date"]] <- + self$`date` + } + if (!is.null(self$`dateTime`)) { + FormatTestObject[["dateTime"]] <- + self$`dateTime` + } + if (!is.null(self$`uuid`)) { + FormatTestObject[["uuid"]] <- + self$`uuid` + } + if (!is.null(self$`password`)) { + FormatTestObject[["password"]] <- + self$`password` + } + if (!is.null(self$`pattern_with_digits`)) { + FormatTestObject[["pattern_with_digits"]] <- + self$`pattern_with_digits` + } + if (!is.null(self$`pattern_with_digits_and_delimiter`)) { + FormatTestObject[["pattern_with_digits_and_delimiter"]] <- + self$`pattern_with_digits_and_delimiter` + } + for (key in names(self$additional_properties)) { + FormatTestObject[[key]] <- self$additional_properties[[key]] + } + + FormatTestObject + }, + #' Deserialize JSON string into an instance of FormatTest + #' + #' @description + #' Deserialize JSON string into an instance of FormatTest + #' + #' @param input_json the JSON input + #' @return the instance of FormatTest + #' @export + fromJSON = function(input_json) { + this_object <- jsonlite::fromJSON(input_json) + if (!is.null(this_object$`integer`)) { + self$`integer` <- this_object$`integer` + } + if (!is.null(this_object$`int32`)) { + self$`int32` <- this_object$`int32` + } + if (!is.null(this_object$`int64`)) { + self$`int64` <- this_object$`int64` + } + if (!is.null(this_object$`number`)) { + self$`number` <- this_object$`number` + } + if (!is.null(this_object$`float`)) { + self$`float` <- this_object$`float` + } + if (!is.null(this_object$`double`)) { + self$`double` <- this_object$`double` + } + if (!is.null(this_object$`string`)) { + self$`string` <- this_object$`string` + } + if (!is.null(this_object$`byte`)) { + self$`byte` <- this_object$`byte` + } + if (!is.null(this_object$`binary`)) { + self$`binary` <- this_object$`binary` + } + if (!is.null(this_object$`date`)) { + self$`date` <- this_object$`date` + } + if (!is.null(this_object$`dateTime`)) { + self$`dateTime` <- this_object$`dateTime` + } + if (!is.null(this_object$`uuid`)) { + self$`uuid` <- this_object$`uuid` + } + if (!is.null(this_object$`password`)) { + self$`password` <- this_object$`password` + } + if (!is.null(this_object$`pattern_with_digits`)) { + self$`pattern_with_digits` <- this_object$`pattern_with_digits` + } + if (!is.null(this_object$`pattern_with_digits_and_delimiter`)) { + self$`pattern_with_digits_and_delimiter` <- this_object$`pattern_with_digits_and_delimiter` + } + # process additional properties/fields in the payload + for (key in names(this_object)) { + if (!(key %in% self$`_field_list`)) { # json key not in list of fields + self$additional_properties[[key]] <- this_object[[key]] + } + } + + self + }, + #' To JSON string + #' + #' @description + #' To JSON String + #' + #' @return FormatTest in JSON format + #' @export + toJSONString = function() { + jsoncontent <- c( + if (!is.null(self$`integer`)) { + sprintf( + '"integer": + %d + ', + self$`integer` + ) + }, + if (!is.null(self$`int32`)) { + sprintf( + '"int32": + %d + ', + self$`int32` + ) + }, + if (!is.null(self$`int64`)) { + sprintf( + '"int64": + %d + ', + self$`int64` + ) + }, + if (!is.null(self$`number`)) { + sprintf( + '"number": + %d + ', + self$`number` + ) + }, + if (!is.null(self$`float`)) { + sprintf( + '"float": + %d + ', + self$`float` + ) + }, + if (!is.null(self$`double`)) { + sprintf( + '"double": + %d + ', + self$`double` + ) + }, + if (!is.null(self$`string`)) { + sprintf( + '"string": + "%s" + ', + self$`string` + ) + }, + if (!is.null(self$`byte`)) { + sprintf( + '"byte": + "%s" + ', + self$`byte` + ) + }, + if (!is.null(self$`binary`)) { + sprintf( + '"binary": + "%s" + ', + self$`binary` + ) + }, + if (!is.null(self$`date`)) { + sprintf( + '"date": + "%s" + ', + self$`date` + ) + }, + if (!is.null(self$`dateTime`)) { + sprintf( + '"dateTime": + "%s" + ', + self$`dateTime` + ) + }, + if (!is.null(self$`uuid`)) { + sprintf( + '"uuid": + "%s" + ', + self$`uuid` + ) + }, + if (!is.null(self$`password`)) { + sprintf( + '"password": + "%s" + ', + self$`password` + ) + }, + if (!is.null(self$`pattern_with_digits`)) { + sprintf( + '"pattern_with_digits": + "%s" + ', + self$`pattern_with_digits` + ) + }, + if (!is.null(self$`pattern_with_digits_and_delimiter`)) { + sprintf( + '"pattern_with_digits_and_delimiter": + "%s" + ', + self$`pattern_with_digits_and_delimiter` + ) + } + ) + jsoncontent <- paste(jsoncontent, collapse = ",") + json_string <- as.character(jsonlite::minify(paste("{", jsoncontent, "}", sep = ""))) + json_obj <- jsonlite::fromJSON(json_string) + for (key in names(self$additional_properties)) { + json_obj[[key]] <- self$additional_properties[[key]] + } + json_string <- as.character(jsonlite::minify(jsonlite::toJSON(json_obj, auto_unbox = TRUE, digits = NA))) + }, + #' Deserialize JSON string into an instance of FormatTest + #' + #' @description + #' Deserialize JSON string into an instance of FormatTest + #' + #' @param input_json the JSON input + #' @return the instance of FormatTest + #' @export + fromJSONString = function(input_json) { + this_object <- jsonlite::fromJSON(input_json) + self$`integer` <- this_object$`integer` + self$`int32` <- this_object$`int32` + self$`int64` <- this_object$`int64` + self$`number` <- this_object$`number` + self$`float` <- this_object$`float` + self$`double` <- this_object$`double` + self$`string` <- this_object$`string` + self$`byte` <- this_object$`byte` + self$`binary` <- this_object$`binary` + self$`date` <- this_object$`date` + self$`dateTime` <- this_object$`dateTime` + self$`uuid` <- this_object$`uuid` + self$`password` <- this_object$`password` + self$`pattern_with_digits` <- this_object$`pattern_with_digits` + self$`pattern_with_digits_and_delimiter` <- this_object$`pattern_with_digits_and_delimiter` + # process additional properties/fields in the payload + for (key in names(this_object)) { + if (!(key %in% self$`_field_list`)) { # json key not in list of fields + self$additional_properties[[key]] <- this_object[[key]] + } + } + + self + }, + #' Validate JSON input with respect to FormatTest + #' + #' @description + #' Validate JSON input with respect to FormatTest and throw an exception if invalid + #' + #' @param input the JSON input + #' @export + validateJSON = function(input) { + input_json <- jsonlite::fromJSON(input) + # check the required field `number` + if (!is.null(input_json$`number`)) { + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `number` is missing.")) + } + # check the required field `byte` + if (!is.null(input_json$`byte`)) { + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `byte` is missing.")) + } + # check the required field `date` + if (!is.null(input_json$`date`)) { + if (!(is.character(input_json$`date`) && length(input_json$`date`) == 1)) { + stop(paste("Error! Invalid data for `date`. Must be a string:", input_json$`date`)) + } + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `date` is missing.")) + } + # check the required field `password` + if (!is.null(input_json$`password`)) { + if (!(is.character(input_json$`password`) && length(input_json$`password`) == 1)) { + stop(paste("Error! Invalid data for `password`. Must be a string:", input_json$`password`)) + } + } else { + stop(paste("The JSON input `", input, "` is invalid for FormatTest: the required field `password` is missing.")) + } + }, + #' To string (JSON format) + #' + #' @description + #' To string (JSON format) + #' + #' @return String representation of FormatTest + #' @export + toString = function() { + self$toJSONString() + }, + #' Return true if the values in all fields are valid. + #' + #' @description + #' Return true if the values in all fields are valid. + #' + #' @return true if the values in all fields are valid. + #' @export + isValid = function() { + if (self$`integer` > 100) { + return(FALSE) + } + if (self$`integer` < 10) { + return(FALSE) + } + + if (self$`int32` > 200) { + return(FALSE) + } + if (self$`int32` < 20) { + return(FALSE) + } + + # check if the required `number` is null + if (is.null(self$`number`)) { + return(FALSE) + } + + if (self$`number` > 543.2) { + return(FALSE) + } + if (self$`number` < 32.1) { + return(FALSE) + } + + if (self$`float` > 987.6) { + return(FALSE) + } + if (self$`float` < 54.3) { + return(FALSE) + } + + if (self$`double` > 123.4) { + return(FALSE) + } + if (self$`double` < 67.8) { + return(FALSE) + } + + if (!str_detect(self$`string`, "[a-z]/i")) { + return(FALSE) + } + + # check if the required `byte` is null + if (is.null(self$`byte`)) { + return(FALSE) + } + + # check if the required `date` is null + if (is.null(self$`date`)) { + return(FALSE) + } + + # check if the required `password` is null + if (is.null(self$`password`)) { + return(FALSE) + } + + if (nchar(self$`password`) > 64) { + return(FALSE) + } + if (nchar(self$`password`) < 10) { + return(FALSE) + } + + if (!str_detect(self$`pattern_with_digits`, "^\\d{10}$")) { + return(FALSE) + } + + if (!str_detect(self$`pattern_with_digits_and_delimiter`, "^image_\\d{1,3}$/i")) { + return(FALSE) + } + + TRUE + }, + #' Return a list of invalid fields (if any). + #' + #' @description + #' Return a list of invalid fields (if any). + #' + #' @return A list of invalid fields (if any). + #' @export + getInvalidFields = function() { + invalid_fields <- list() + if (self$`integer` > 100) { + invalid_fields["integer"] <- "Invalid value for `integer`, must be smaller than or equal to 100." + } + if (self$`integer` < 10) { + invalid_fields["integer"] <- "Invalid value for `integer`, must be bigger than or equal to 10." + } + + if (self$`int32` > 200) { + invalid_fields["int32"] <- "Invalid value for `int32`, must be smaller than or equal to 200." + } + if (self$`int32` < 20) { + invalid_fields["int32"] <- "Invalid value for `int32`, must be bigger than or equal to 20." + } + + # check if the required `number` is null + if (is.null(self$`number`)) { + invalid_fields["number"] <- "Non-nullable required field `number` cannot be null." + } + + if (self$`number` > 543.2) { + invalid_fields["number"] <- "Invalid value for `number`, must be smaller than or equal to 543.2." + } + if (self$`number` < 32.1) { + invalid_fields["number"] <- "Invalid value for `number`, must be bigger than or equal to 32.1." + } + + if (self$`float` > 987.6) { + invalid_fields["float"] <- "Invalid value for `float`, must be smaller than or equal to 987.6." + } + if (self$`float` < 54.3) { + invalid_fields["float"] <- "Invalid value for `float`, must be bigger than or equal to 54.3." + } + + if (self$`double` > 123.4) { + invalid_fields["double"] <- "Invalid value for `double`, must be smaller than or equal to 123.4." + } + if (self$`double` < 67.8) { + invalid_fields["double"] <- "Invalid value for `double`, must be bigger than or equal to 67.8." + } + + if (!str_detect(self$`string`, "[a-z]/i")) { + invalid_fields["string"] <- "Invalid value for `string`, must conform to the pattern [a-z]/i." + } + + # check if the required `byte` is null + if (is.null(self$`byte`)) { + invalid_fields["byte"] <- "Non-nullable required field `byte` cannot be null." + } + + # check if the required `date` is null + if (is.null(self$`date`)) { + invalid_fields["date"] <- "Non-nullable required field `date` cannot be null." + } + + # check if the required `password` is null + if (is.null(self$`password`)) { + invalid_fields["password"] <- "Non-nullable required field `password` cannot be null." + } + + if (nchar(self$`password`) > 64) { + invalid_fields["password"] <- "Invalid length for `password`, must be smaller than or equal to 64." + } + if (nchar(self$`password`) < 10) { + invalid_fields["password"] <- "Invalid length for `password`, must be bigger than or equal to 10." + } + + if (!str_detect(self$`pattern_with_digits`, "^\\d{10}$")) { + invalid_fields["pattern_with_digits"] <- "Invalid value for `pattern_with_digits`, must conform to the pattern ^\\d{10}$." + } + + if (!str_detect(self$`pattern_with_digits_and_delimiter`, "^image_\\d{1,3}$/i")) { + invalid_fields["pattern_with_digits_and_delimiter"] <- "Invalid value for `pattern_with_digits_and_delimiter`, must conform to the pattern ^image_\\d{1,3}$/i." + } + + invalid_fields + }, + #' Print the object + #' + #' @description + #' Print the object + #' + #' @export + print = function() { + print(jsonlite::prettify(self$toJSONString())) + invisible(self) + } + ), + # Lock the class to prevent modifications to the method or field + lock_class = TRUE +) +## Uncomment below to unlock the class to allow modifications of the method or field +# FormatTest$unlock() +# +## Below is an example to define the print fnuction +# FormatTest$set("public", "print", function(...) { +# print(jsonlite::prettify(self$toJSONString())) +# invisible(self) +# }) +## Uncomment below to lock the class to prevent modifications to the method or field +# FormatTest$lock() + diff --git a/samples/client/petstore/R/R/model_api_response.R b/samples/client/petstore/R/R/model_api_response.R index 03059bb5225..b0e4bbba7e9 100644 --- a/samples/client/petstore/R/R/model_api_response.R +++ b/samples/client/petstore/R/R/model_api_response.R @@ -36,15 +36,21 @@ ModelApiResponse <- R6::R6Class( #' @export initialize = function(`code` = NULL, `type` = NULL, `message` = NULL, additional_properties = NULL, ...) { if (!is.null(`code`)) { - stopifnot(is.numeric(`code`), length(`code`) == 1) + if (!(is.numeric(`code`) && length(`code`) == 1)) { + stop(paste("Error! Invalid data for `code`. Must be an integer:", `code`)) + } self$`code` <- `code` } if (!is.null(`type`)) { - stopifnot(is.character(`type`), length(`type`) == 1) + if (!(is.character(`type`) && length(`type`) == 1)) { + stop(paste("Error! Invalid data for `type`. Must be a string:", `type`)) + } self$`type` <- `type` } if (!is.null(`message`)) { - stopifnot(is.character(`message`), length(`message`) == 1) + if (!(is.character(`message`) && length(`message`) == 1)) { + stop(paste("Error! Invalid data for `message`. Must be a string:", `message`)) + } self$`message` <- `message` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R/R/nested_one_of.R b/samples/client/petstore/R/R/nested_one_of.R index 68b0db6b371..73f4e938cbd 100644 --- a/samples/client/petstore/R/R/nested_one_of.R +++ b/samples/client/petstore/R/R/nested_one_of.R @@ -33,7 +33,9 @@ NestedOneOf <- R6::R6Class( #' @export initialize = function(`size` = NULL, `nested_pig` = NULL, additional_properties = NULL, ...) { if (!is.null(`size`)) { - stopifnot(is.numeric(`size`), length(`size`) == 1) + if (!(is.numeric(`size`) && length(`size`) == 1)) { + stop(paste("Error! Invalid data for `size`. Must be an integer:", `size`)) + } self$`size` <- `size` } if (!is.null(`nested_pig`)) { diff --git a/samples/client/petstore/R/R/order.R b/samples/client/petstore/R/R/order.R index 6f43799918d..26646896269 100644 --- a/samples/client/petstore/R/R/order.R +++ b/samples/client/petstore/R/R/order.R @@ -45,30 +45,42 @@ Order <- R6::R6Class( #' @export initialize = function(`id` = NULL, `petId` = NULL, `quantity` = NULL, `shipDate` = NULL, `status` = NULL, `complete` = FALSE, additional_properties = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`petId`)) { - stopifnot(is.numeric(`petId`), length(`petId`) == 1) + if (!(is.numeric(`petId`) && length(`petId`) == 1)) { + stop(paste("Error! Invalid data for `petId`. Must be an integer:", `petId`)) + } self$`petId` <- `petId` } if (!is.null(`quantity`)) { - stopifnot(is.numeric(`quantity`), length(`quantity`) == 1) + if (!(is.numeric(`quantity`) && length(`quantity`) == 1)) { + stop(paste("Error! Invalid data for `quantity`. Must be an integer:", `quantity`)) + } self$`quantity` <- `quantity` } if (!is.null(`shipDate`)) { - stopifnot(is.character(`shipDate`), length(`shipDate`) == 1) + if (!is.character(`shipDate`)) { + stop(paste("Error! Invalid data for `shipDate`. Must be a string:", `shipDate`)) + } self$`shipDate` <- `shipDate` } if (!is.null(`status`)) { if (!(`status` %in% c("placed", "approved", "delivered"))) { stop(paste("Error! \"", `status`, "\" cannot be assigned to `status`. Must be \"placed\", \"approved\", \"delivered\".", sep = "")) } - stopifnot(is.character(`status`), length(`status`) == 1) + if (!(is.character(`status`) && length(`status`) == 1)) { + stop(paste("Error! Invalid data for `status`. Must be a string:", `status`)) + } self$`status` <- `status` } if (!is.null(`complete`)) { - stopifnot(is.logical(`complete`), length(`complete`) == 1) + if (!(is.logical(`complete`) && length(`complete`) == 1)) { + stop(paste("Error! Invalid data for `complete`. Must be a boolean:", `complete`)) + } self$`complete` <- `complete` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R/R/pet.R b/samples/client/petstore/R/R/pet.R index 63318448c0c..8be5a058335 100644 --- a/samples/client/petstore/R/R/pet.R +++ b/samples/client/petstore/R/R/pet.R @@ -45,7 +45,9 @@ Pet <- R6::R6Class( #' @export initialize = function(`name`, `photoUrls`, `id` = NULL, `category` = NULL, `tags` = NULL, `status` = NULL, additional_properties = NULL, ...) { if (!missing(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } if (!missing(`photoUrls`)) { @@ -54,7 +56,9 @@ Pet <- R6::R6Class( self$`photoUrls` <- `photoUrls` } if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`category`)) { @@ -70,7 +74,9 @@ Pet <- R6::R6Class( if (!(`status` %in% c("available", "pending", "sold"))) { stop(paste("Error! \"", `status`, "\" cannot be assigned to `status`. Must be \"available\", \"pending\", \"sold\".", sep = "")) } - stopifnot(is.character(`status`), length(`status`) == 1) + if (!(is.character(`status`) && length(`status`) == 1)) { + stop(paste("Error! Invalid data for `status`. Must be a string:", `status`)) + } self$`status` <- `status` } if (!is.null(additional_properties)) { @@ -265,7 +271,9 @@ Pet <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `name` if (!is.null(input_json$`name`)) { - stopifnot(is.character(input_json$`name`), length(input_json$`name`) == 1) + if (!(is.character(input_json$`name`) && length(input_json$`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", input_json$`name`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `name` is missing.")) } diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index 19f1a04b1f6..e407d3c708c 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -288,7 +288,7 @@ #' #################### AddPet #################### #' #' library(petstore) -#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store #' #' #Add a new pet to the store #' api_instance <- PetApi$new() @@ -326,7 +326,7 @@ #' #' library(petstore) #' var_pet_id <- 56 # integer | Pet id to delete -#' var_api_key <- "api_key_example" # character | +#' var_api_key <- "api_key_example" # character | (Optional) #' #' #Deletes a pet #' api_instance <- PetApi$new() @@ -354,7 +354,7 @@ #' #################### FindPetsByStatus #################### #' #' library(petstore) -#' var_status <- ["status_example"] # array[character] | Status values that need to be considered for filter +#' var_status <- c("available") # array[character] | Status values that need to be considered for filter #' #' #Finds Pets by status #' api_instance <- PetApi$new() @@ -390,7 +390,7 @@ #' #################### FindPetsByTags #################### #' #' library(petstore) -#' var_tags <- ["tags_example"] # array[character] | Tags to filter by +#' var_tags <- c("inner_example") # array[character] | Tags to filter by #' #' #Finds Pets by tags #' api_instance <- PetApi$new() @@ -537,7 +537,7 @@ #' #################### UpdatePet #################### #' #' library(petstore) -#' var_pet <- Pet$new() # Pet | Pet object that needs to be added to the store +#' var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store #' #' #Update an existing pet #' api_instance <- PetApi$new() @@ -574,8 +574,8 @@ #' #' library(petstore) #' var_pet_id <- 56 # integer | ID of pet that needs to be updated -#' var_name <- "name_example" # character | Updated name of the pet -#' var_status <- "status_example" # character | Updated status of the pet +#' var_name <- "name_example" # character | Updated name of the pet (Optional) +#' var_status <- "status_example" # character | Updated status of the pet (Optional) #' #' #Updates a pet in the store with form data #' api_instance <- PetApi$new() @@ -601,8 +601,8 @@ #' #' library(petstore) #' var_pet_id <- 56 # integer | ID of pet to update -#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server -#' var_file <- File.new('/path/to/file') # data.frame | file to upload +#' var_additional_metadata <- "additional_metadata_example" # character | Additional data to pass to server (Optional) +#' var_file <- File.new('/path/to/file') # data.frame | file to upload (Optional) #' #' #uploads an image #' api_instance <- PetApi$new() diff --git a/samples/client/petstore/R/R/special.R b/samples/client/petstore/R/R/special.R index 33f06cc6a67..39664bea75c 100644 --- a/samples/client/petstore/R/R/special.R +++ b/samples/client/petstore/R/R/special.R @@ -56,27 +56,39 @@ Special <- R6::R6Class( self$`set_test` <- `set_test` } if (!is.null(`item_self`)) { - stopifnot(is.numeric(`item_self`), length(`item_self`) == 1) + if (!(is.numeric(`item_self`) && length(`item_self`) == 1)) { + stop(paste("Error! Invalid data for `item_self`. Must be an integer:", `item_self`)) + } self$`item_self` <- `item_self` } if (!is.null(`item_private`)) { - stopifnot(is.character(`item_private`), length(`item_private`) == 1) + if (!(is.character(`item_private`) && length(`item_private`) == 1)) { + stop(paste("Error! Invalid data for `item_private`. Must be a string:", `item_private`)) + } self$`item_private` <- `item_private` } if (!is.null(`item_super`)) { - stopifnot(is.character(`item_super`), length(`item_super`) == 1) + if (!(is.character(`item_super`) && length(`item_super`) == 1)) { + stop(paste("Error! Invalid data for `item_super`. Must be a string:", `item_super`)) + } self$`item_super` <- `item_super` } if (!is.null(`123_number`)) { - stopifnot(is.character(`123_number`), length(`123_number`) == 1) + if (!(is.character(`123_number`) && length(`123_number`) == 1)) { + stop(paste("Error! Invalid data for `123_number`. Must be a string:", `123_number`)) + } self$`123_number` <- `123_number` } if (!is.null(`array[test]`)) { - stopifnot(is.character(`array[test]`), length(`array[test]`) == 1) + if (!(is.character(`array[test]`) && length(`array[test]`) == 1)) { + stop(paste("Error! Invalid data for `array[test]`. Must be a string:", `array[test]`)) + } self$`array[test]` <- `array[test]` } if (!is.null(`empty_string`)) { - stopifnot(is.character(`empty_string`), length(`empty_string`) == 1) + if (!(is.character(`empty_string`) && length(`empty_string`) == 1)) { + stop(paste("Error! Invalid data for `empty_string`. Must be a string:", `empty_string`)) + } self$`empty_string` <- `empty_string` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index ec9b71aabf0..1daff7db820 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -211,7 +211,7 @@ #' #################### PlaceOrder #################### #' #' library(petstore) -#' var_order <- Order$new() # Order | order placed for purchasing the pet +#' var_order <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet #' #' #Place an order for a pet #' api_instance <- StoreApi$new() diff --git a/samples/client/petstore/R/R/tag.R b/samples/client/petstore/R/R/tag.R index bd4aac10e2f..be068d1474c 100644 --- a/samples/client/petstore/R/R/tag.R +++ b/samples/client/petstore/R/R/tag.R @@ -33,11 +33,15 @@ Tag <- R6::R6Class( #' @export initialize = function(`id` = NULL, `name` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`name`)) { - stopifnot(is.character(`name`), length(`name`) == 1) + if (!(is.character(`name`) && length(`name`) == 1)) { + stop(paste("Error! Invalid data for `name`. Must be a string:", `name`)) + } self$`name` <- `name` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R/R/user.R b/samples/client/petstore/R/R/user.R index 153aacb3ea5..43b51ffa41c 100644 --- a/samples/client/petstore/R/R/user.R +++ b/samples/client/petstore/R/R/user.R @@ -51,35 +51,51 @@ User <- R6::R6Class( #' @export initialize = function(`id` = NULL, `username` = NULL, `firstName` = NULL, `lastName` = NULL, `email` = NULL, `password` = NULL, `phone` = NULL, `userStatus` = NULL, additional_properties = NULL, ...) { if (!is.null(`id`)) { - stopifnot(is.numeric(`id`), length(`id`) == 1) + if (!(is.numeric(`id`) && length(`id`) == 1)) { + stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) + } self$`id` <- `id` } if (!is.null(`username`)) { - stopifnot(is.character(`username`), length(`username`) == 1) + if (!(is.character(`username`) && length(`username`) == 1)) { + stop(paste("Error! Invalid data for `username`. Must be a string:", `username`)) + } self$`username` <- `username` } if (!is.null(`firstName`)) { - stopifnot(is.character(`firstName`), length(`firstName`) == 1) + if (!(is.character(`firstName`) && length(`firstName`) == 1)) { + stop(paste("Error! Invalid data for `firstName`. Must be a string:", `firstName`)) + } self$`firstName` <- `firstName` } if (!is.null(`lastName`)) { - stopifnot(is.character(`lastName`), length(`lastName`) == 1) + if (!(is.character(`lastName`) && length(`lastName`) == 1)) { + stop(paste("Error! Invalid data for `lastName`. Must be a string:", `lastName`)) + } self$`lastName` <- `lastName` } if (!is.null(`email`)) { - stopifnot(is.character(`email`), length(`email`) == 1) + if (!(is.character(`email`) && length(`email`) == 1)) { + stop(paste("Error! Invalid data for `email`. Must be a string:", `email`)) + } self$`email` <- `email` } if (!is.null(`password`)) { - stopifnot(is.character(`password`), length(`password`) == 1) + if (!(is.character(`password`) && length(`password`) == 1)) { + stop(paste("Error! Invalid data for `password`. Must be a string:", `password`)) + } self$`password` <- `password` } if (!is.null(`phone`)) { - stopifnot(is.character(`phone`), length(`phone`) == 1) + if (!(is.character(`phone`) && length(`phone`) == 1)) { + stop(paste("Error! Invalid data for `phone`. Must be a string:", `phone`)) + } self$`phone` <- `phone` } if (!is.null(`userStatus`)) { - stopifnot(is.numeric(`userStatus`), length(`userStatus`) == 1) + if (!(is.numeric(`userStatus`) && length(`userStatus`) == 1)) { + stop(paste("Error! Invalid data for `userStatus`. Must be an integer:", `userStatus`)) + } self$`userStatus` <- `userStatus` } if (!is.null(additional_properties)) { diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index 34e6a7b10b4..0f0243a7b68 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -197,7 +197,7 @@ #' #################### CreateUser #################### #' #' library(petstore) -#' var_user <- User$new() # User | Created user object +#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Created user object #' #' #Create user #' api_instance <- UserApi$new() @@ -225,7 +225,7 @@ #' #################### CreateUsersWithArrayInput #################### #' #' library(petstore) -#' var_user <- [User$new()] # array[User] | List of user object +#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object #' #' #Creates list of users with given input array #' api_instance <- UserApi$new() @@ -253,7 +253,7 @@ #' #################### CreateUsersWithListInput #################### #' #' library(petstore) -#' var_user <- [User$new()] # array[User] | List of user object +#' var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object #' #' #Creates list of users with given input array #' api_instance <- UserApi$new() @@ -404,7 +404,7 @@ #' #' library(petstore) #' var_username <- "username_example" # character | name that need to be deleted -#' var_user <- User$new() # User | Updated user object +#' var_user <- User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123) # User | Updated user object #' #' #Updated user #' api_instance <- UserApi$new() diff --git a/samples/client/petstore/R/R/whale.R b/samples/client/petstore/R/R/whale.R index 936b3a2573e..dc70b1dd33e 100644 --- a/samples/client/petstore/R/R/whale.R +++ b/samples/client/petstore/R/R/whale.R @@ -36,15 +36,21 @@ Whale <- R6::R6Class( #' @export initialize = function(`className`, `hasBaleen` = NULL, `hasTeeth` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`hasBaleen`)) { - stopifnot(is.logical(`hasBaleen`), length(`hasBaleen`) == 1) + if (!(is.logical(`hasBaleen`) && length(`hasBaleen`) == 1)) { + stop(paste("Error! Invalid data for `hasBaleen`. Must be a boolean:", `hasBaleen`)) + } self$`hasBaleen` <- `hasBaleen` } if (!is.null(`hasTeeth`)) { - stopifnot(is.logical(`hasTeeth`), length(`hasTeeth`) == 1) + if (!(is.logical(`hasTeeth`) && length(`hasTeeth`) == 1)) { + stop(paste("Error! Invalid data for `hasTeeth`. Must be a boolean:", `hasTeeth`)) + } self$`hasTeeth` <- `hasTeeth` } if (!is.null(additional_properties)) { @@ -183,7 +189,9 @@ Whale <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Whale: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R/R/zebra.R b/samples/client/petstore/R/R/zebra.R index 5c090e84cbb..c8d06d23d6a 100644 --- a/samples/client/petstore/R/R/zebra.R +++ b/samples/client/petstore/R/R/zebra.R @@ -33,14 +33,18 @@ Zebra <- R6::R6Class( #' @export initialize = function(`className`, `type` = NULL, additional_properties = NULL, ...) { if (!missing(`className`)) { - stopifnot(is.character(`className`), length(`className`) == 1) + if (!(is.character(`className`) && length(`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", `className`)) + } self$`className` <- `className` } if (!is.null(`type`)) { if (!(`type` %in% c("plains", "mountain", "grevys"))) { stop(paste("Error! \"", `type`, "\" cannot be assigned to `type`. Must be \"plains\", \"mountain\", \"grevys\".", sep = "")) } - stopifnot(is.character(`type`), length(`type`) == 1) + if (!(is.character(`type`) && length(`type`) == 1)) { + stop(paste("Error! Invalid data for `type`. Must be a string:", `type`)) + } self$`type` <- `type` } if (!is.null(additional_properties)) { @@ -169,7 +173,9 @@ Zebra <- R6::R6Class( input_json <- jsonlite::fromJSON(input) # check the required field `className` if (!is.null(input_json$`className`)) { - stopifnot(is.character(input_json$`className`), length(input_json$`className`) == 1) + if (!(is.character(input_json$`className`) && length(input_json$`className`) == 1)) { + stop(paste("Error! Invalid data for `className`. Must be a string:", input_json$`className`)) + } } else { stop(paste("The JSON input `", input, "` is invalid for Zebra: the required field `className` is missing.")) } diff --git a/samples/client/petstore/R/README.md b/samples/client/petstore/R/README.md index 263e44af2d5..39c03b3133c 100644 --- a/samples/client/petstore/R/README.md +++ b/samples/client/petstore/R/README.md @@ -115,6 +115,7 @@ Class | Method | HTTP request | Description - [Date](docs/Date.md) - [Dog](docs/Dog.md) - [DogAllOf](docs/DogAllOf.md) + - [FormatTest](docs/FormatTest.md) - [Mammal](docs/Mammal.md) - [ModelApiResponse](docs/ModelApiResponse.md) - [NestedOneOf](docs/NestedOneOf.md) diff --git a/samples/client/petstore/R/docs/FakeApi.md b/samples/client/petstore/R/docs/FakeApi.md index 4e3f7464f14..fd8b6e450dc 100644 --- a/samples/client/petstore/R/docs/FakeApi.md +++ b/samples/client/petstore/R/docs/FakeApi.md @@ -25,7 +25,7 @@ library(petstore) # Add a new pet to the store (optional body) # # prepare function argument(s) -var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional) +var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store (Optional) api_instance <- FakeApi$new() # Configure HTTP basic authorization: http_auth @@ -153,7 +153,7 @@ library(petstore) # test array parameter in path # # prepare function argument(s) -var_path_array <- list("inner_example") # array[character] | dummy path parameter +var_path_array <- c("inner_example") # array[character] | dummy path parameter api_instance <- FakeApi$new() result <- tryCatch( @@ -263,8 +263,8 @@ library(petstore) # test set query parameter # # prepare function argument(s) -var_set_dummy <- list("inner_example") # set[character] | set query -var_array_dummy <- list("inner_example") # array[character] | array query +var_set_dummy <- c("inner_example") # set[character] | set query +var_array_dummy <- c("inner_example") # array[character] | array query api_instance <- FakeApi$new() result <- tryCatch( diff --git a/samples/client/petstore/R/docs/FormatTest.md b/samples/client/petstore/R/docs/FormatTest.md new file mode 100644 index 00000000000..1d483f62704 --- /dev/null +++ b/samples/client/petstore/R/docs/FormatTest.md @@ -0,0 +1,23 @@ +# petstore::FormatTest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **integer** | | [optional] [Max: 100] [Min: 10] +**int32** | **integer** | | [optional] [Max: 200] [Min: 20] +**int64** | **integer** | | [optional] +**number** | **numeric** | | [Max: 543.2] [Min: 32.1] +**float** | **numeric** | | [optional] [Max: 987.6] [Min: 54.3] +**double** | **numeric** | | [optional] [Max: 123.4] [Min: 67.8] +**string** | **character** | | [optional] [Pattern: [a-z]/i] +**byte** | **character** | | +**binary** | **data.frame** | | [optional] +**date** | **character** | | [default to "Fri Jul 19 00:00:00 UTC 2019"] +**dateTime** | **character** | | [optional] [default to "2015-10-28T14:38:02Z"] +**uuid** | **character** | | [optional] +**password** | **character** | | [Max. length: 64] [Min. length: 10] +**pattern_with_digits** | **character** | A string that is a 10 digit number. Can have leading zeros. | [optional] [Pattern: ^\\d{10}$] +**pattern_with_digits_and_delimiter** | **character** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [Pattern: ^image_\\d{1,3}$/i] + + diff --git a/samples/client/petstore/R/docs/PetApi.md b/samples/client/petstore/R/docs/PetApi.md index c493fe2da37..58cb4a02d06 100644 --- a/samples/client/petstore/R/docs/PetApi.md +++ b/samples/client/petstore/R/docs/PetApi.md @@ -30,7 +30,7 @@ library(petstore) # Add a new pet to the store # # prepare function argument(s) -var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store +var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store api_instance <- PetApi$new() # Configure HTTP basic authorization: http_auth @@ -154,7 +154,7 @@ library(petstore) # Finds Pets by status # # prepare function argument(s) -var_status <- list("available") # array[character] | Status values that need to be considered for filter +var_status <- c("available") # array[character] | Status values that need to be considered for filter api_instance <- PetApi$new() # Configure OAuth2 access token for authorization: petstore_auth @@ -218,7 +218,7 @@ library(petstore) # Finds Pets by tags # # prepare function argument(s) -var_tags <- list("inner_example") # array[character] | Tags to filter by +var_tags <- c("inner_example") # array[character] | Tags to filter by api_instance <- PetApi$new() result <- tryCatch( @@ -479,7 +479,7 @@ library(petstore) # Update an existing pet # # prepare function argument(s) -var_pet <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store +var_pet <- Pet$new("name_example", c("photoUrls_example"), 123, Category$new(123, "name_example"), c(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store api_instance <- PetApi$new() # Configure OAuth2 access token for authorization: petstore_auth diff --git a/samples/client/petstore/R/docs/UserApi.md b/samples/client/petstore/R/docs/UserApi.md index ffc5e09b9e6..4554672053e 100644 --- a/samples/client/petstore/R/docs/UserApi.md +++ b/samples/client/petstore/R/docs/UserApi.md @@ -85,7 +85,7 @@ library(petstore) # Creates list of users with given input array # # prepare function argument(s) -var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object +var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object api_instance <- UserApi$new() # Configure API key authorization: api_key @@ -142,7 +142,7 @@ library(petstore) # Creates list of users with given input array # # prepare function argument(s) -var_user <- list(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object +var_user <- c(User$new(123, "username_example", "firstName_example", "lastName_example", "email_example", "password_example", "phone_example", 123)) # array[User] | List of user object api_instance <- UserApi$new() # Configure API key authorization: api_key diff --git a/samples/client/petstore/R/tests/testthat/test_format_test.R b/samples/client/petstore/R/tests/testthat/test_format_test.R new file mode 100644 index 00000000000..47963949104 --- /dev/null +++ b/samples/client/petstore/R/tests/testthat/test_format_test.R @@ -0,0 +1,113 @@ +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate + +context("Test FormatTest") + +model_instance <- FormatTest$new() + +test_that("integer", { + # tests for the property `integer` (integer) + + # uncomment below to test the property + #expect_equal(model.instance$`integer`, "EXPECTED_RESULT") +}) + +test_that("int32", { + # tests for the property `int32` (integer) + + # uncomment below to test the property + #expect_equal(model.instance$`int32`, "EXPECTED_RESULT") +}) + +test_that("int64", { + # tests for the property `int64` (integer) + + # uncomment below to test the property + #expect_equal(model.instance$`int64`, "EXPECTED_RESULT") +}) + +test_that("number", { + # tests for the property `number` (numeric) + + # uncomment below to test the property + #expect_equal(model.instance$`number`, "EXPECTED_RESULT") +}) + +test_that("float", { + # tests for the property `float` (numeric) + + # uncomment below to test the property + #expect_equal(model.instance$`float`, "EXPECTED_RESULT") +}) + +test_that("double", { + # tests for the property `double` (numeric) + + # uncomment below to test the property + #expect_equal(model.instance$`double`, "EXPECTED_RESULT") +}) + +test_that("string", { + # tests for the property `string` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`string`, "EXPECTED_RESULT") +}) + +test_that("byte", { + # tests for the property `byte` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`byte`, "EXPECTED_RESULT") +}) + +test_that("binary", { + # tests for the property `binary` (data.frame) + + # uncomment below to test the property + #expect_equal(model.instance$`binary`, "EXPECTED_RESULT") +}) + +test_that("date", { + # tests for the property `date` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`date`, "EXPECTED_RESULT") +}) + +test_that("dateTime", { + # tests for the property `dateTime` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`dateTime`, "EXPECTED_RESULT") +}) + +test_that("uuid", { + # tests for the property `uuid` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`uuid`, "EXPECTED_RESULT") +}) + +test_that("password", { + # tests for the property `password` (character) + + # uncomment below to test the property + #expect_equal(model.instance$`password`, "EXPECTED_RESULT") +}) + +test_that("pattern_with_digits", { + # tests for the property `pattern_with_digits` (character) + # A string that is a 10 digit number. Can have leading zeros. + + # uncomment below to test the property + #expect_equal(model.instance$`pattern_with_digits`, "EXPECTED_RESULT") +}) + +test_that("pattern_with_digits_and_delimiter", { + # tests for the property `pattern_with_digits_and_delimiter` (character) + # A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + + # uncomment below to test the property + #expect_equal(model.instance$`pattern_with_digits_and_delimiter`, "EXPECTED_RESULT") +}) 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 e99cb9be46c..917a723fcc6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES @@ -2,6 +2,8 @@ Org.OpenAPITools.sln README.md appveyor.yml +docs/Activity.md +docs/ActivityOutputElementRepresentation.md docs/AdditionalPropertiesClass.md docs/Animal.md docs/AnotherFakeApi.md @@ -116,6 +118,8 @@ src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs src/Org.OpenAPITools/Client/RequestOptions.cs src/Org.OpenAPITools/Client/RetryConfiguration.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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md index fdc4b49e799..99c92a26a6b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/README.md @@ -147,6 +147,8 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [Model.Activity](docs/Activity.md) + - [Model.ActivityOutputElementRepresentation](docs/ActivityOutputElementRepresentation.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [Model.Animal](docs/Animal.md) - [Model.ApiResponse](docs/ApiResponse.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/Activity.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/Activity.md new file mode 100644 index 00000000000..27a4e457199 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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-ConditionalSerialization/docs/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..21f226b3952 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/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-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..f211a64884a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.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 Xunit; + +using System; +using 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; + +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 + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..afe9e846ee9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +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 + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + + } + +} 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 e499a7728e4..608bdbc195a 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 @@ -13,6 +13,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; @@ -116,6 +117,8 @@ namespace Org.OpenAPITools.Client return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } @@ -214,5 +217,40 @@ namespace Org.OpenAPITools.Client 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-ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..62b70440f67 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.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 +{ + /// + /// test map of maps + /// + [DataContract(Name = "Activity")] + public partial class Activity : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs. + public Activity(Dictionary> activityOutputs = default(Dictionary>)) + { + this._ActivityOutputs = activityOutputs; + if (this.ActivityOutputs != null) + { + this._flagActivityOutputs = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ActivityOutputs + /// + [DataMember(Name = "activity_outputs", EmitDefaultValue = false)] + public Dictionary> ActivityOutputs + { + get{ return _ActivityOutputs;} + set + { + _ActivityOutputs = value; + _flagActivityOutputs = true; + } + } + private Dictionary> _ActivityOutputs; + private bool _flagActivityOutputs; + + /// + /// Returns false as ActivityOutputs should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeActivityOutputs() + { + return _flagActivityOutputs; + } + /// + /// 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).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 Activity).AreEqual; + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity 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.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable 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 new file mode 100644 index 00000000000..7395af5fbf1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -0,0 +1,189 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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 +{ + /// + /// ActivityOutputElementRepresentation + /// + [DataContract(Name = "ActivityOutputElementRepresentation")] + public partial class ActivityOutputElementRepresentation : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// prop1. + /// prop2. + public ActivityOutputElementRepresentation(string prop1 = default(string), Object prop2 = default(Object)) + { + this._Prop1 = prop1; + if (this.Prop1 != null) + { + this._flagProp1 = true; + } + this._Prop2 = prop2; + if (this.Prop2 != null) + { + this._flagProp2 = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Prop1 + /// + [DataMember(Name = "prop1", EmitDefaultValue = false)] + public string Prop1 + { + get{ return _Prop1;} + set + { + _Prop1 = value; + _flagProp1 = true; + } + } + private string _Prop1; + private bool _flagProp1; + + /// + /// Returns false as Prop1 should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeProp1() + { + return _flagProp1; + } + /// + /// Gets or Sets Prop2 + /// + [DataMember(Name = "prop2", EmitDefaultValue = false)] + public Object Prop2 + { + get{ return _Prop2;} + set + { + _Prop2 = value; + _flagProp2 = true; + } + } + private Object _Prop2; + private bool _flagProp2; + + /// + /// Returns false as Prop2 should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeProp2() + { + return _flagProp2; + } + /// + /// 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).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 ActivityOutputElementRepresentation).AreEqual; + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation 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.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 9a99c9d18bc..cf0f5c871be 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 @@ -9,6 +9,8 @@ docs/apis/FakeClassnameTags123Api.md docs/apis/PetApi.md docs/apis/StoreApi.md docs/apis/UserApi.md +docs/models/Activity.md +docs/models/ActivityOutputElementRepresentation.md docs/models/AdditionalPropertiesClass.md docs/models/Animal.md docs/models/ApiResponse.md @@ -115,6 +117,8 @@ src/Org.OpenAPITools/Client/RateLimitProvider`1.cs src/Org.OpenAPITools/Client/TokenBase.cs src/Org.OpenAPITools/Client/TokenContainer`1.cs src/Org.OpenAPITools/Client/TokenProvider`1.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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Activity.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Activity.md new file mode 100644 index 00000000000..6f69ec32545 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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-generichost-net6.0-nrt/docs/models/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..33d79a27692 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/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-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 new file mode 100644 index 00000000000..f211a64884a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.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 Xunit; + +using System; +using 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; + +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 + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + + } + +} 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 new file mode 100644 index 00000000000..afe9e846ee9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +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 + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + + } + +} 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 new file mode 100644 index 00000000000..d8753f6553e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Activity.cs @@ -0,0 +1,121 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this 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.Runtime.Serialization; +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 +{ + /// + /// test map of maps + /// + public partial class Activity : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs + public Activity(Dictionary>? activityOutputs = default) + { + ActivityOutputs = activityOutputs; + } + + /// + /// Gets or Sets ActivityOutputs + /// + [JsonPropertyName("activity_outputs")] + public Dictionary>? ActivityOutputs { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; set; } = 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object? input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Activity).AreEqual; + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity? 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.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 new file mode 100644 index 00000000000..2cd5bb9372e --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.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 + */ + +#nullable enable + +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 System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ActivityOutputElementRepresentation + /// + public partial class ActivityOutputElementRepresentation : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// prop1 + /// prop2 + public ActivityOutputElementRepresentation(string? prop1 = default, Object? prop2 = default) + { + Prop1 = prop1; + Prop2 = prop2; + } + + /// + /// Gets or Sets Prop1 + /// + [JsonPropertyName("prop1")] + public string? Prop1 { get; set; } + + /// + /// Gets or Sets Prop2 + /// + [JsonPropertyName("prop2")] + public Object? Prop2 { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; set; } = 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object? input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ActivityOutputElementRepresentation).AreEqual; + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation? 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.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 9a99c9d18bc..cf0f5c871be 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 @@ -9,6 +9,8 @@ docs/apis/FakeClassnameTags123Api.md docs/apis/PetApi.md docs/apis/StoreApi.md docs/apis/UserApi.md +docs/models/Activity.md +docs/models/ActivityOutputElementRepresentation.md docs/models/AdditionalPropertiesClass.md docs/models/Animal.md docs/models/ApiResponse.md @@ -115,6 +117,8 @@ src/Org.OpenAPITools/Client/RateLimitProvider`1.cs src/Org.OpenAPITools/Client/TokenBase.cs src/Org.OpenAPITools/Client/TokenContainer`1.cs src/Org.OpenAPITools/Client/TokenProvider`1.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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Activity.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Activity.md new file mode 100644 index 00000000000..6f69ec32545 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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-generichost-net6.0/docs/models/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..33d79a27692 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/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-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 new file mode 100644 index 00000000000..f211a64884a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.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 Xunit; + +using System; +using 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; + +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 + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + + } + +} 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 new file mode 100644 index 00000000000..afe9e846ee9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +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 + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + + } + +} 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 new file mode 100644 index 00000000000..68647a4ae15 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/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 System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// test map of maps + /// + public partial class Activity : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs + public Activity(Dictionary> activityOutputs = default) + { + ActivityOutputs = activityOutputs; + } + + /// + /// Gets or Sets ActivityOutputs + /// + [JsonPropertyName("activity_outputs")] + public Dictionary> ActivityOutputs { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; set; } = 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Activity).AreEqual; + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity 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.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 new file mode 100644 index 00000000000..ed290bab607 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.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 System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ActivityOutputElementRepresentation + /// + public partial class ActivityOutputElementRepresentation : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// prop1 + /// prop2 + public ActivityOutputElementRepresentation(string prop1 = default, Object prop2 = default) + { + Prop1 = prop1; + Prop2 = prop2; + } + + /// + /// Gets or Sets Prop1 + /// + [JsonPropertyName("prop1")] + public string Prop1 { get; set; } + + /// + /// Gets or Sets Prop2 + /// + [JsonPropertyName("prop2")] + public Object Prop2 { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; set; } = 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ActivityOutputElementRepresentation).AreEqual; + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation 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.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 9a99c9d18bc..cf0f5c871be 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 @@ -9,6 +9,8 @@ docs/apis/FakeClassnameTags123Api.md docs/apis/PetApi.md docs/apis/StoreApi.md docs/apis/UserApi.md +docs/models/Activity.md +docs/models/ActivityOutputElementRepresentation.md docs/models/AdditionalPropertiesClass.md docs/models/Animal.md docs/models/ApiResponse.md @@ -115,6 +117,8 @@ src/Org.OpenAPITools/Client/RateLimitProvider`1.cs src/Org.OpenAPITools/Client/TokenBase.cs src/Org.OpenAPITools/Client/TokenContainer`1.cs src/Org.OpenAPITools/Client/TokenProvider`1.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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Activity.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Activity.md new file mode 100644 index 00000000000..6f69ec32545 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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-generichost-netstandard2.0/docs/models/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..33d79a27692 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/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-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 new file mode 100644 index 00000000000..f211a64884a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.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 Xunit; + +using System; +using 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; + +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 + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + + } + +} 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 new file mode 100644 index 00000000000..afe9e846ee9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +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 + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + + } + +} 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 new file mode 100644 index 00000000000..68647a4ae15 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/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 System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// test map of maps + /// + public partial class Activity : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs + public Activity(Dictionary> activityOutputs = default) + { + ActivityOutputs = activityOutputs; + } + + /// + /// Gets or Sets ActivityOutputs + /// + [JsonPropertyName("activity_outputs")] + public Dictionary> ActivityOutputs { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; set; } = 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as Activity).AreEqual; + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity 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.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 new file mode 100644 index 00000000000..ed290bab607 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.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 System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ActivityOutputElementRepresentation + /// + public partial class ActivityOutputElementRepresentation : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// prop1 + /// prop2 + public ActivityOutputElementRepresentation(string prop1 = default, Object prop2 = default) + { + Prop1 = prop1; + Prop2 = prop2; + } + + /// + /// Gets or Sets Prop1 + /// + [JsonPropertyName("prop1")] + public string Prop1 { get; set; } + + /// + /// Gets or Sets Prop2 + /// + [JsonPropertyName("prop2")] + public Object Prop2 { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; set; } = 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as ActivityOutputElementRepresentation).AreEqual; + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation 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.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 3b9f8295454..95d1165749d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/FILES @@ -2,6 +2,8 @@ Org.OpenAPITools.sln README.md appveyor.yml +docs/Activity.md +docs/ActivityOutputElementRepresentation.md docs/AdditionalPropertiesClass.md docs/Animal.md docs/AnotherFakeApi.md @@ -113,6 +115,8 @@ src/Org.OpenAPITools/Client/RequestOptions.cs src/Org.OpenAPITools/Client/RetryConfiguration.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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/README.md index f52ed7e7e68..ba5e4d45f47 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/README.md @@ -172,6 +172,8 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [Model.Activity](docs/Activity.md) + - [Model.ActivityOutputElementRepresentation](docs/ActivityOutputElementRepresentation.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [Model.Animal](docs/Animal.md) - [Model.ApiResponse](docs/ApiResponse.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/Activity.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/Activity.md new file mode 100644 index 00000000000..27a4e457199 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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-httpclient/docs/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..21f226b3952 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/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-httpclient/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..f211a64884a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.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 Xunit; + +using System; +using 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; + +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 + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..afe9e846ee9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +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 + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + + } + +} 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 e499a7728e4..608bdbc195a 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 @@ -13,6 +13,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; @@ -116,6 +117,8 @@ namespace Org.OpenAPITools.Client return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } @@ -214,5 +217,40 @@ namespace Org.OpenAPITools.Client 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-httpclient/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..a883381f9c7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Activity.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 +{ + /// + /// test map of maps + /// + [DataContract(Name = "Activity")] + public partial class Activity : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs. + public Activity(Dictionary> activityOutputs = default(Dictionary>)) + { + this.ActivityOutputs = activityOutputs; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ActivityOutputs + /// + [DataMember(Name = "activity_outputs", EmitDefaultValue = false)] + public Dictionary> ActivityOutputs { 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).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 Activity).AreEqual; + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity 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.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable 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 new file mode 100644 index 00000000000..065c023d0a5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.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 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 +{ + /// + /// ActivityOutputElementRepresentation + /// + [DataContract(Name = "ActivityOutputElementRepresentation")] + public partial class ActivityOutputElementRepresentation : IEquatable, IValidatableObject + { + /// + /// 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; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// 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; } + + /// + /// 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).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 ActivityOutputElementRepresentation).AreEqual; + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation 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.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 e99cb9be46c..917a723fcc6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/FILES @@ -2,6 +2,8 @@ Org.OpenAPITools.sln README.md appveyor.yml +docs/Activity.md +docs/ActivityOutputElementRepresentation.md docs/AdditionalPropertiesClass.md docs/Animal.md docs/AnotherFakeApi.md @@ -116,6 +118,8 @@ src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs src/Org.OpenAPITools/Client/RequestOptions.cs src/Org.OpenAPITools/Client/RetryConfiguration.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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md index b3a20c0c083..aeefb0f54ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/README.md @@ -159,6 +159,8 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [Model.Activity](docs/Activity.md) + - [Model.ActivityOutputElementRepresentation](docs/ActivityOutputElementRepresentation.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [Model.Animal](docs/Animal.md) - [Model.ApiResponse](docs/ApiResponse.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/Activity.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/Activity.md new file mode 100644 index 00000000000..27a4e457199 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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-net47/docs/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..21f226b3952 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/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-net47/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..f211a64884a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.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 Xunit; + +using System; +using 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; + +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 + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..afe9e846ee9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +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 + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + + } + +} 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 e499a7728e4..608bdbc195a 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 @@ -13,6 +13,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; @@ -116,6 +117,8 @@ namespace Org.OpenAPITools.Client return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } @@ -214,5 +217,40 @@ namespace Org.OpenAPITools.Client 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-net47/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..38f1573adb2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Activity.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 +{ + /// + /// test map of maps + /// + [DataContract(Name = "Activity")] + public partial class Activity : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs. + public Activity(Dictionary> activityOutputs = default(Dictionary>)) + { + this.ActivityOutputs = activityOutputs; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ActivityOutputs + /// + [DataMember(Name = "activity_outputs", EmitDefaultValue = false)] + public Dictionary> ActivityOutputs { 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).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 Activity).AreEqual; + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity 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.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable 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 new file mode 100644 index 00000000000..59a301721b2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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 +{ + /// + /// ActivityOutputElementRepresentation + /// + [DataContract(Name = "ActivityOutputElementRepresentation")] + public partial class ActivityOutputElementRepresentation : IEquatable, IValidatableObject + { + /// + /// 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; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// 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; } + + /// + /// 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).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 ActivityOutputElementRepresentation).AreEqual; + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation 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.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 e99cb9be46c..917a723fcc6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/.openapi-generator/FILES @@ -2,6 +2,8 @@ Org.OpenAPITools.sln README.md appveyor.yml +docs/Activity.md +docs/ActivityOutputElementRepresentation.md docs/AdditionalPropertiesClass.md docs/Animal.md docs/AnotherFakeApi.md @@ -116,6 +118,8 @@ src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs src/Org.OpenAPITools/Client/RequestOptions.cs src/Org.OpenAPITools/Client/RetryConfiguration.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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/README.md index b3a20c0c083..aeefb0f54ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/README.md @@ -159,6 +159,8 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [Model.Activity](docs/Activity.md) + - [Model.ActivityOutputElementRepresentation](docs/ActivityOutputElementRepresentation.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [Model.Animal](docs/Animal.md) - [Model.ApiResponse](docs/ApiResponse.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/Activity.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/Activity.md new file mode 100644 index 00000000000..27a4e457199 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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-net48/docs/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..21f226b3952 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/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-net48/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..f211a64884a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.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 Xunit; + +using System; +using 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; + +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 + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..afe9e846ee9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +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 + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + + } + +} 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 e499a7728e4..608bdbc195a 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 @@ -13,6 +13,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; @@ -116,6 +117,8 @@ namespace Org.OpenAPITools.Client return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } @@ -214,5 +217,40 @@ namespace Org.OpenAPITools.Client 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-net48/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..38f1573adb2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Activity.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 +{ + /// + /// test map of maps + /// + [DataContract(Name = "Activity")] + public partial class Activity : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs. + public Activity(Dictionary> activityOutputs = default(Dictionary>)) + { + this.ActivityOutputs = activityOutputs; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ActivityOutputs + /// + [DataMember(Name = "activity_outputs", EmitDefaultValue = false)] + public Dictionary> ActivityOutputs { 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).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 Activity).AreEqual; + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity 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.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable 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 new file mode 100644 index 00000000000..59a301721b2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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 +{ + /// + /// ActivityOutputElementRepresentation + /// + [DataContract(Name = "ActivityOutputElementRepresentation")] + public partial class ActivityOutputElementRepresentation : IEquatable, IValidatableObject + { + /// + /// 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; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// 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; } + + /// + /// 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).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 ActivityOutputElementRepresentation).AreEqual; + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation 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.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 e99cb9be46c..917a723fcc6 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 @@ -2,6 +2,8 @@ Org.OpenAPITools.sln README.md appveyor.yml +docs/Activity.md +docs/ActivityOutputElementRepresentation.md docs/AdditionalPropertiesClass.md docs/Animal.md docs/AnotherFakeApi.md @@ -116,6 +118,8 @@ src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs src/Org.OpenAPITools/Client/RequestOptions.cs src/Org.OpenAPITools/Client/RetryConfiguration.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 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 b3a20c0c083..aeefb0f54ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/README.md @@ -159,6 +159,8 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [Model.Activity](docs/Activity.md) + - [Model.ActivityOutputElementRepresentation](docs/ActivityOutputElementRepresentation.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [Model.Animal](docs/Animal.md) - [Model.ApiResponse](docs/ApiResponse.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/Activity.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/Activity.md new file mode 100644 index 00000000000..27a4e457199 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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-net5.0/docs/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..21f226b3952 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/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-net5.0/docs/PetStatusFilter.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/PetStatusFilter.md new file mode 100644 index 00000000000..ce995e71d57 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/PetStatusFilter.md @@ -0,0 +1,9 @@ +# Org.OpenAPITools.Model.PetStatusFilter + +## 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-net5.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..f211a64884a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.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 Xunit; + +using System; +using 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; + +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 + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..afe9e846ee9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +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 + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/PetStatusFilterTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/PetStatusFilterTests.cs new file mode 100644 index 00000000000..2a26d8deff7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/PetStatusFilterTests.cs @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing PetStatusFilter + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetStatusFilterTests : IDisposable + { + // TODO uncomment below to declare an instance variable for PetStatusFilter + //private PetStatusFilter instance; + + public PetStatusFilterTests() + { + // TODO uncomment below to create an instance of PetStatusFilter + //instance = new PetStatusFilter(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PetStatusFilter + /// + [Fact] + public void PetStatusFilterInstanceTest() + { + // TODO uncomment below to test "IsType" PetStatusFilter + //Assert.IsType(instance); + } + + + + } + +} 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 e499a7728e4..608bdbc195a 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 @@ -13,6 +13,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; @@ -116,6 +117,8 @@ namespace Org.OpenAPITools.Client return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } @@ -214,5 +217,40 @@ namespace Org.OpenAPITools.Client 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-net5.0/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..38f1573adb2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Activity.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 +{ + /// + /// test map of maps + /// + [DataContract(Name = "Activity")] + public partial class Activity : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs. + public Activity(Dictionary> activityOutputs = default(Dictionary>)) + { + this.ActivityOutputs = activityOutputs; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ActivityOutputs + /// + [DataMember(Name = "activity_outputs", EmitDefaultValue = false)] + public Dictionary> ActivityOutputs { 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).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 Activity).AreEqual; + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity 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.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable 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 new file mode 100644 index 00000000000..59a301721b2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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 +{ + /// + /// ActivityOutputElementRepresentation + /// + [DataContract(Name = "ActivityOutputElementRepresentation")] + public partial class ActivityOutputElementRepresentation : IEquatable, IValidatableObject + { + /// + /// 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; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// 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; } + + /// + /// 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).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 ActivityOutputElementRepresentation).AreEqual; + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation 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.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/PetStatusFilter.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/PetStatusFilter.cs new file mode 100644 index 00000000000..ff5525b83ca --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/PetStatusFilter.cs @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * 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 +{ + /// + /// Defines PetStatusFilter + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PetStatusFilter + { + /// + /// 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 + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES index ba71e29dcc7..59f6d50ea71 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES @@ -2,6 +2,8 @@ Org.OpenAPITools.sln README.md appveyor.yml +docs/Activity.md +docs/ActivityOutputElementRepresentation.md docs/AdditionalPropertiesClass.md docs/Animal.md docs/AnotherFakeApi.md @@ -115,6 +117,8 @@ src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs src/Org.OpenAPITools/Client/RequestOptions.cs src/Org.OpenAPITools/Client/RetryConfiguration.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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md index fdc4b49e799..99c92a26a6b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md @@ -147,6 +147,8 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [Model.Activity](docs/Activity.md) + - [Model.ActivityOutputElementRepresentation](docs/ActivityOutputElementRepresentation.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [Model.Animal](docs/Animal.md) - [Model.ApiResponse](docs/ApiResponse.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/Activity.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/Activity.md new file mode 100644 index 00000000000..27a4e457199 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/docs/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..21f226b3952 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/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/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..f211a64884a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.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 Xunit; + +using System; +using 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; + +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 + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..afe9e846ee9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +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 + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + + } + +} 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 e499a7728e4..608bdbc195a 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 @@ -13,6 +13,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; @@ -116,6 +117,8 @@ namespace Org.OpenAPITools.Client return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } @@ -214,5 +217,40 @@ namespace Org.OpenAPITools.Client 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/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..38f1573adb2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Activity.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 +{ + /// + /// test map of maps + /// + [DataContract(Name = "Activity")] + public partial class Activity : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// activityOutputs. + public Activity(Dictionary> activityOutputs = default(Dictionary>)) + { + this.ActivityOutputs = activityOutputs; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets ActivityOutputs + /// + [DataMember(Name = "activity_outputs", EmitDefaultValue = false)] + public Dictionary> ActivityOutputs { 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 Activity {\n"); + sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).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 Activity).AreEqual; + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity 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.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable 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 new file mode 100644 index 00000000000..59a301721b2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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 +{ + /// + /// ActivityOutputElementRepresentation + /// + [DataContract(Name = "ActivityOutputElementRepresentation")] + public partial class ActivityOutputElementRepresentation : IEquatable, IValidatableObject + { + /// + /// 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; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// 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; } + + /// + /// 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 ActivityOutputElementRepresentation {\n"); + sb.Append(" Prop1: ").Append(Prop1).Append("\n"); + sb.Append(" Prop2: ").Append(Prop2).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 ActivityOutputElementRepresentation).AreEqual; + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation 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.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES index ba71e29dcc7..59f6d50ea71 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES @@ -2,6 +2,8 @@ Org.OpenAPITools.sln README.md appveyor.yml +docs/Activity.md +docs/ActivityOutputElementRepresentation.md docs/AdditionalPropertiesClass.md docs/Animal.md docs/AnotherFakeApi.md @@ -115,6 +117,8 @@ src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs src/Org.OpenAPITools/Client/RequestOptions.cs src/Org.OpenAPITools/Client/RetryConfiguration.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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md index b3a20c0c083..aeefb0f54ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md @@ -159,6 +159,8 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [Model.Activity](docs/Activity.md) + - [Model.ActivityOutputElementRepresentation](docs/ActivityOutputElementRepresentation.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [Model.Animal](docs/Animal.md) - [Model.ApiResponse](docs/ApiResponse.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/Activity.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/Activity.md new file mode 100644 index 00000000000..27a4e457199 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/Activity.md @@ -0,0 +1,11 @@ +# Org.OpenAPITools.Model.Activity +test map of maps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/OpenAPIClientCore/docs/ActivityOutputElementRepresentation.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/ActivityOutputElementRepresentation.md new file mode 100644 index 00000000000..21f226b3952 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/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/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs new file mode 100644 index 00000000000..f211a64884a --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.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 Xunit; + +using System; +using 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; + +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 + /// + [Fact] + public void ActivityOutputElementRepresentationInstanceTest() + { + // TODO uncomment below to test "IsType" ActivityOutputElementRepresentation + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Prop1' + /// + [Fact] + public void Prop1Test() + { + // TODO unit test for the property 'Prop1' + } + /// + /// Test the property 'Prop2' + /// + [Fact] + public void Prop2Test() + { + // TODO unit test for the property 'Prop2' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs new file mode 100644 index 00000000000..afe9e846ee9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/ActivityTests.cs @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for 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.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +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 + /// + [Fact] + public void ActivityInstanceTest() + { + // TODO uncomment below to test "IsType" Activity + //Assert.IsType(instance); + } + + + /// + /// Test the property 'ActivityOutputs' + /// + [Fact] + public void ActivityOutputsTest() + { + // TODO unit test for the property 'ActivityOutputs' + } + + } + +} 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 e499a7728e4..608bdbc195a 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 @@ -13,6 +13,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; @@ -116,6 +117,8 @@ namespace Org.OpenAPITools.Client return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } @@ -214,5 +217,40 @@ namespace Org.OpenAPITools.Client 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/OpenAPIClientCore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Activity.cs new file mode 100644 index 00000000000..625d71bfff7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Activity.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 +{ + /// + /// test map of maps + /// + [DataContract(Name = "Activity")] + public partial class Activity : IEquatable, IValidatableObject + { + /// + /// 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 OpenAPIClientUtils.compareLogic.Compare(this, input as Activity).AreEqual; + } + + /// + /// Returns true if Activity instances are equal + /// + /// Instance of Activity to be compared + /// Boolean + public bool Equals(Activity 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.ActivityOutputs != null) + { + hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable 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 new file mode 100644 index 00000000000..677b79cc20d --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// ActivityOutputElementRepresentation + /// + [DataContract(Name = "ActivityOutputElementRepresentation")] + public partial class ActivityOutputElementRepresentation : IEquatable, IValidatableObject + { + /// + /// 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 OpenAPIClientUtils.compareLogic.Compare(this, input as ActivityOutputElementRepresentation).AreEqual; + } + + /// + /// Returns true if ActivityOutputElementRepresentation instances are equal + /// + /// Instance of ActivityOutputElementRepresentation to be compared + /// Boolean + public bool Equals(ActivityOutputElementRepresentation 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.Prop1 != null) + { + hashCode = (hashCode * 59) + this.Prop1.GetHashCode(); + } + if (this.Prop2 != null) + { + hashCode = (hashCode * 59) + this.Prop2.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} 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 21fe44c8dfa..a2cd17c0c2c 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 @@ -13,6 +13,7 @@ using System.Collections; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using KellermanSoftware.CompareNetObjects; @@ -116,6 +117,8 @@ namespace Org.OpenAPITools.Client return boolean ? "true" : "false"; if (obj is ICollection collection) return string.Join(",", collection.Cast()); + if (obj is Enum && HasEnumMemberAttrValue(obj)) + return GetEnumMemberAttrValue(obj); return Convert.ToString(obj, CultureInfo.InvariantCulture); } @@ -214,5 +217,40 @@ namespace Org.OpenAPITools.Client 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/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 80c1125f22e..16c9dca0ae8 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -1976,6 +1976,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -1985,6 +1986,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2004,6 +2006,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2076,6 +2079,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2087,6 +2091,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2098,6 +2103,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index f872380df96..b48d903b06a 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -135,7 +135,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { // Check the type is as expected. if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) } return nil } @@ -474,7 +474,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e } if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) + err = fmt.Errorf("invalid body type %s\n", contentType) return nil, err } return bodyBuf, nil @@ -576,3 +576,23 @@ func (e GenericOpenAPIError) Body() []byte { func (e GenericOpenAPIError) Model() interface{} { return e.model } + +// format error message using title and detail when model implements rfc7807 +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()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + + // status title (detail) + return fmt.Sprintf("%s %s", status, str) +} diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index 326eb245319..94d3b3bc4f9 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -123,7 +123,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { // URL formats template on a index using given variables func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) } server := sc[index] url := server.URL @@ -138,7 +138,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri } } if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) } url = strings.Replace(url, "{"+name+"}", value, -1) } else { diff --git a/samples/client/petstore/go/go-petstore/model_200_response.go b/samples/client/petstore/go/go-petstore/model_200_response.go index 68e469454ae..53a803b1303 100644 --- a/samples/client/petstore/go/go-petstore/model_200_response.go +++ b/samples/client/petstore/go/go-petstore/model_200_response.go @@ -39,7 +39,7 @@ func NewModel200ResponseWithDefaults() *Model200Response { // GetName returns the Name field value if set, zero value otherwise. func (o *Model200Response) GetName() int32 { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret int32 return ret } @@ -49,15 +49,15 @@ func (o *Model200Response) GetName() int32 { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Model200Response) GetNameOk() (*int32, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *Model200Response) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -71,7 +71,7 @@ func (o *Model200Response) SetName(v int32) { // GetClass returns the Class field value if set, zero value otherwise. func (o *Model200Response) GetClass() string { - if o == nil || o.Class == nil { + if o == nil || isNil(o.Class) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *Model200Response) GetClass() string { // GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Model200Response) GetClassOk() (*string, bool) { - if o == nil || o.Class == nil { - return nil, false + if o == nil || isNil(o.Class) { + return nil, false } return o.Class, true } // HasClass returns a boolean if a field has been set. func (o *Model200Response) HasClass() bool { - if o != nil && o.Class != nil { + if o != nil && !isNil(o.Class) { return true } @@ -103,10 +103,10 @@ func (o *Model200Response) SetClass(v string) { func (o Model200Response) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } - if o.Class != nil { + if !isNil(o.Class) { toSerialize["class"] = o.Class } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go b/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go index ee9be1b1d87..ccbfd32b867 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go @@ -38,7 +38,7 @@ func NewAdditionalPropertiesAnyTypeWithDefaults() *AdditionalPropertiesAnyType { // GetName returns the Name field value if set, zero value otherwise. func (o *AdditionalPropertiesAnyType) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *AdditionalPropertiesAnyType) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesAnyType) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *AdditionalPropertiesAnyType) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -70,7 +70,7 @@ func (o *AdditionalPropertiesAnyType) SetName(v string) { func (o AdditionalPropertiesAnyType) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_array.go b/samples/client/petstore/go/go-petstore/model_additional_properties_array.go index 5d2cd29a4fc..24f75bcd6bb 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_array.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_array.go @@ -38,7 +38,7 @@ func NewAdditionalPropertiesArrayWithDefaults() *AdditionalPropertiesArray { // GetName returns the Name field value if set, zero value otherwise. func (o *AdditionalPropertiesArray) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *AdditionalPropertiesArray) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesArray) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *AdditionalPropertiesArray) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -70,7 +70,7 @@ func (o *AdditionalPropertiesArray) SetName(v string) { func (o AdditionalPropertiesArray) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go b/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go index eaa524de6a6..f354bfd38cb 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go @@ -38,7 +38,7 @@ func NewAdditionalPropertiesBooleanWithDefaults() *AdditionalPropertiesBoolean { // GetName returns the Name field value if set, zero value otherwise. func (o *AdditionalPropertiesBoolean) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *AdditionalPropertiesBoolean) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesBoolean) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *AdditionalPropertiesBoolean) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -70,7 +70,7 @@ func (o *AdditionalPropertiesBoolean) SetName(v string) { func (o AdditionalPropertiesBoolean) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_class.go b/samples/client/petstore/go/go-petstore/model_additional_properties_class.go index e5ec45291f2..21f240005fa 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_class.go @@ -48,7 +48,7 @@ func NewAdditionalPropertiesClassWithDefaults() *AdditionalPropertiesClass { // GetMapString returns the MapString field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetMapString() map[string]string { - if o == nil || o.MapString == nil { + if o == nil || isNil(o.MapString) { var ret map[string]string return ret } @@ -58,15 +58,15 @@ func (o *AdditionalPropertiesClass) GetMapString() map[string]string { // GetMapStringOk returns a tuple with the MapString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetMapStringOk() (*map[string]string, bool) { - if o == nil || o.MapString == nil { - return nil, false + if o == nil || isNil(o.MapString) { + return nil, false } return o.MapString, true } // HasMapString returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasMapString() bool { - if o != nil && o.MapString != nil { + if o != nil && !isNil(o.MapString) { return true } @@ -80,7 +80,7 @@ func (o *AdditionalPropertiesClass) SetMapString(v map[string]string) { // GetMapNumber returns the MapNumber field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetMapNumber() map[string]float32 { - if o == nil || o.MapNumber == nil { + if o == nil || isNil(o.MapNumber) { var ret map[string]float32 return ret } @@ -90,15 +90,15 @@ func (o *AdditionalPropertiesClass) GetMapNumber() map[string]float32 { // GetMapNumberOk returns a tuple with the MapNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetMapNumberOk() (*map[string]float32, bool) { - if o == nil || o.MapNumber == nil { - return nil, false + if o == nil || isNil(o.MapNumber) { + return nil, false } return o.MapNumber, true } // HasMapNumber returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasMapNumber() bool { - if o != nil && o.MapNumber != nil { + if o != nil && !isNil(o.MapNumber) { return true } @@ -112,7 +112,7 @@ func (o *AdditionalPropertiesClass) SetMapNumber(v map[string]float32) { // GetMapInteger returns the MapInteger field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetMapInteger() map[string]int32 { - if o == nil || o.MapInteger == nil { + if o == nil || isNil(o.MapInteger) { var ret map[string]int32 return ret } @@ -122,15 +122,15 @@ func (o *AdditionalPropertiesClass) GetMapInteger() map[string]int32 { // GetMapIntegerOk returns a tuple with the MapInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetMapIntegerOk() (*map[string]int32, bool) { - if o == nil || o.MapInteger == nil { - return nil, false + if o == nil || isNil(o.MapInteger) { + return nil, false } return o.MapInteger, true } // HasMapInteger returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasMapInteger() bool { - if o != nil && o.MapInteger != nil { + if o != nil && !isNil(o.MapInteger) { return true } @@ -144,7 +144,7 @@ func (o *AdditionalPropertiesClass) SetMapInteger(v map[string]int32) { // GetMapBoolean returns the MapBoolean field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetMapBoolean() map[string]bool { - if o == nil || o.MapBoolean == nil { + if o == nil || isNil(o.MapBoolean) { var ret map[string]bool return ret } @@ -154,15 +154,15 @@ func (o *AdditionalPropertiesClass) GetMapBoolean() map[string]bool { // GetMapBooleanOk returns a tuple with the MapBoolean field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetMapBooleanOk() (*map[string]bool, bool) { - if o == nil || o.MapBoolean == nil { - return nil, false + if o == nil || isNil(o.MapBoolean) { + return nil, false } return o.MapBoolean, true } // HasMapBoolean returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasMapBoolean() bool { - if o != nil && o.MapBoolean != nil { + if o != nil && !isNil(o.MapBoolean) { return true } @@ -176,7 +176,7 @@ func (o *AdditionalPropertiesClass) SetMapBoolean(v map[string]bool) { // GetMapArrayInteger returns the MapArrayInteger field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetMapArrayInteger() map[string][]int32 { - if o == nil || o.MapArrayInteger == nil { + if o == nil || isNil(o.MapArrayInteger) { var ret map[string][]int32 return ret } @@ -186,15 +186,15 @@ func (o *AdditionalPropertiesClass) GetMapArrayInteger() map[string][]int32 { // GetMapArrayIntegerOk returns a tuple with the MapArrayInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetMapArrayIntegerOk() (*map[string][]int32, bool) { - if o == nil || o.MapArrayInteger == nil { - return nil, false + if o == nil || isNil(o.MapArrayInteger) { + return nil, false } return o.MapArrayInteger, true } // HasMapArrayInteger returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasMapArrayInteger() bool { - if o != nil && o.MapArrayInteger != nil { + if o != nil && !isNil(o.MapArrayInteger) { return true } @@ -208,7 +208,7 @@ func (o *AdditionalPropertiesClass) SetMapArrayInteger(v map[string][]int32) { // GetMapArrayAnytype returns the MapArrayAnytype field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetMapArrayAnytype() map[string][]map[string]interface{} { - if o == nil || o.MapArrayAnytype == nil { + if o == nil || isNil(o.MapArrayAnytype) { var ret map[string][]map[string]interface{} return ret } @@ -218,15 +218,15 @@ func (o *AdditionalPropertiesClass) GetMapArrayAnytype() map[string][]map[string // GetMapArrayAnytypeOk returns a tuple with the MapArrayAnytype field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetMapArrayAnytypeOk() (*map[string][]map[string]interface{}, bool) { - if o == nil || o.MapArrayAnytype == nil { - return nil, false + if o == nil || isNil(o.MapArrayAnytype) { + return nil, false } return o.MapArrayAnytype, true } // HasMapArrayAnytype returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasMapArrayAnytype() bool { - if o != nil && o.MapArrayAnytype != nil { + if o != nil && !isNil(o.MapArrayAnytype) { return true } @@ -240,7 +240,7 @@ func (o *AdditionalPropertiesClass) SetMapArrayAnytype(v map[string][]map[string // GetMapMapString returns the MapMapString field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetMapMapString() map[string]map[string]string { - if o == nil || o.MapMapString == nil { + if o == nil || isNil(o.MapMapString) { var ret map[string]map[string]string return ret } @@ -250,15 +250,15 @@ func (o *AdditionalPropertiesClass) GetMapMapString() map[string]map[string]stri // GetMapMapStringOk returns a tuple with the MapMapString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetMapMapStringOk() (*map[string]map[string]string, bool) { - if o == nil || o.MapMapString == nil { - return nil, false + if o == nil || isNil(o.MapMapString) { + return nil, false } return o.MapMapString, true } // HasMapMapString returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasMapMapString() bool { - if o != nil && o.MapMapString != nil { + if o != nil && !isNil(o.MapMapString) { return true } @@ -272,7 +272,7 @@ func (o *AdditionalPropertiesClass) SetMapMapString(v map[string]map[string]stri // GetMapMapAnytype returns the MapMapAnytype field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetMapMapAnytype() map[string]map[string]map[string]interface{} { - if o == nil || o.MapMapAnytype == nil { + if o == nil || isNil(o.MapMapAnytype) { var ret map[string]map[string]map[string]interface{} return ret } @@ -282,15 +282,15 @@ func (o *AdditionalPropertiesClass) GetMapMapAnytype() map[string]map[string]map // GetMapMapAnytypeOk returns a tuple with the MapMapAnytype field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetMapMapAnytypeOk() (*map[string]map[string]map[string]interface{}, bool) { - if o == nil || o.MapMapAnytype == nil { - return nil, false + if o == nil || isNil(o.MapMapAnytype) { + return nil, false } return o.MapMapAnytype, true } // HasMapMapAnytype returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasMapMapAnytype() bool { - if o != nil && o.MapMapAnytype != nil { + if o != nil && !isNil(o.MapMapAnytype) { return true } @@ -304,7 +304,7 @@ func (o *AdditionalPropertiesClass) SetMapMapAnytype(v map[string]map[string]map // GetAnytype1 returns the Anytype1 field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetAnytype1() map[string]interface{} { - if o == nil || o.Anytype1 == nil { + if o == nil || isNil(o.Anytype1) { var ret map[string]interface{} return ret } @@ -314,15 +314,15 @@ func (o *AdditionalPropertiesClass) GetAnytype1() map[string]interface{} { // GetAnytype1Ok returns a tuple with the Anytype1 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetAnytype1Ok() (map[string]interface{}, bool) { - if o == nil || o.Anytype1 == nil { - return nil, false + if o == nil || isNil(o.Anytype1) { + return map[string]interface{}{}, false } return o.Anytype1, true } // HasAnytype1 returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasAnytype1() bool { - if o != nil && o.Anytype1 != nil { + if o != nil && !isNil(o.Anytype1) { return true } @@ -336,7 +336,7 @@ func (o *AdditionalPropertiesClass) SetAnytype1(v map[string]interface{}) { // GetAnytype2 returns the Anytype2 field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetAnytype2() map[string]interface{} { - if o == nil || o.Anytype2 == nil { + if o == nil || isNil(o.Anytype2) { var ret map[string]interface{} return ret } @@ -346,15 +346,15 @@ func (o *AdditionalPropertiesClass) GetAnytype2() map[string]interface{} { // GetAnytype2Ok returns a tuple with the Anytype2 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetAnytype2Ok() (map[string]interface{}, bool) { - if o == nil || o.Anytype2 == nil { - return nil, false + if o == nil || isNil(o.Anytype2) { + return map[string]interface{}{}, false } return o.Anytype2, true } // HasAnytype2 returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasAnytype2() bool { - if o != nil && o.Anytype2 != nil { + if o != nil && !isNil(o.Anytype2) { return true } @@ -368,7 +368,7 @@ func (o *AdditionalPropertiesClass) SetAnytype2(v map[string]interface{}) { // GetAnytype3 returns the Anytype3 field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetAnytype3() map[string]interface{} { - if o == nil || o.Anytype3 == nil { + if o == nil || isNil(o.Anytype3) { var ret map[string]interface{} return ret } @@ -378,15 +378,15 @@ func (o *AdditionalPropertiesClass) GetAnytype3() map[string]interface{} { // GetAnytype3Ok returns a tuple with the Anytype3 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetAnytype3Ok() (map[string]interface{}, bool) { - if o == nil || o.Anytype3 == nil { - return nil, false + if o == nil || isNil(o.Anytype3) { + return map[string]interface{}{}, false } return o.Anytype3, true } // HasAnytype3 returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasAnytype3() bool { - if o != nil && o.Anytype3 != nil { + if o != nil && !isNil(o.Anytype3) { return true } @@ -400,37 +400,37 @@ func (o *AdditionalPropertiesClass) SetAnytype3(v map[string]interface{}) { func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MapString != nil { + if !isNil(o.MapString) { toSerialize["map_string"] = o.MapString } - if o.MapNumber != nil { + if !isNil(o.MapNumber) { toSerialize["map_number"] = o.MapNumber } - if o.MapInteger != nil { + if !isNil(o.MapInteger) { toSerialize["map_integer"] = o.MapInteger } - if o.MapBoolean != nil { + if !isNil(o.MapBoolean) { toSerialize["map_boolean"] = o.MapBoolean } - if o.MapArrayInteger != nil { + if !isNil(o.MapArrayInteger) { toSerialize["map_array_integer"] = o.MapArrayInteger } - if o.MapArrayAnytype != nil { + if !isNil(o.MapArrayAnytype) { toSerialize["map_array_anytype"] = o.MapArrayAnytype } - if o.MapMapString != nil { + if !isNil(o.MapMapString) { toSerialize["map_map_string"] = o.MapMapString } - if o.MapMapAnytype != nil { + if !isNil(o.MapMapAnytype) { toSerialize["map_map_anytype"] = o.MapMapAnytype } - if o.Anytype1 != nil { + if !isNil(o.Anytype1) { toSerialize["anytype_1"] = o.Anytype1 } - if o.Anytype2 != nil { + if !isNil(o.Anytype2) { toSerialize["anytype_2"] = o.Anytype2 } - if o.Anytype3 != nil { + if !isNil(o.Anytype3) { toSerialize["anytype_3"] = o.Anytype3 } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go b/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go index d1e86c00c62..f4f6d506e51 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go @@ -38,7 +38,7 @@ func NewAdditionalPropertiesIntegerWithDefaults() *AdditionalPropertiesInteger { // GetName returns the Name field value if set, zero value otherwise. func (o *AdditionalPropertiesInteger) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *AdditionalPropertiesInteger) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesInteger) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *AdditionalPropertiesInteger) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -70,7 +70,7 @@ func (o *AdditionalPropertiesInteger) SetName(v string) { func (o AdditionalPropertiesInteger) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_number.go b/samples/client/petstore/go/go-petstore/model_additional_properties_number.go index 6db900c29fc..04c192d4330 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_number.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_number.go @@ -38,7 +38,7 @@ func NewAdditionalPropertiesNumberWithDefaults() *AdditionalPropertiesNumber { // GetName returns the Name field value if set, zero value otherwise. func (o *AdditionalPropertiesNumber) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *AdditionalPropertiesNumber) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesNumber) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *AdditionalPropertiesNumber) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -70,7 +70,7 @@ func (o *AdditionalPropertiesNumber) SetName(v string) { func (o AdditionalPropertiesNumber) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_object.go b/samples/client/petstore/go/go-petstore/model_additional_properties_object.go index ec78c54ca63..b2c2df5625b 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_object.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_object.go @@ -38,7 +38,7 @@ func NewAdditionalPropertiesObjectWithDefaults() *AdditionalPropertiesObject { // GetName returns the Name field value if set, zero value otherwise. func (o *AdditionalPropertiesObject) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *AdditionalPropertiesObject) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesObject) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *AdditionalPropertiesObject) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -70,7 +70,7 @@ func (o *AdditionalPropertiesObject) SetName(v string) { func (o AdditionalPropertiesObject) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_string.go b/samples/client/petstore/go/go-petstore/model_additional_properties_string.go index 7856fc31558..06e571f77e5 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_string.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_string.go @@ -38,7 +38,7 @@ func NewAdditionalPropertiesStringWithDefaults() *AdditionalPropertiesString { // GetName returns the Name field value if set, zero value otherwise. func (o *AdditionalPropertiesString) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *AdditionalPropertiesString) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesString) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *AdditionalPropertiesString) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -70,7 +70,7 @@ func (o *AdditionalPropertiesString) SetName(v string) { func (o AdditionalPropertiesString) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_animal.go b/samples/client/petstore/go/go-petstore/model_animal.go index 7b7534c3a54..72a80684bdb 100644 --- a/samples/client/petstore/go/go-petstore/model_animal.go +++ b/samples/client/petstore/go/go-petstore/model_animal.go @@ -56,7 +56,7 @@ func (o *Animal) GetClassName() string { // and a boolean to check if the value has been set. func (o *Animal) GetClassNameOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.ClassName, true } @@ -68,7 +68,7 @@ func (o *Animal) SetClassName(v string) { // GetColor returns the Color field value if set, zero value otherwise. func (o *Animal) GetColor() string { - if o == nil || o.Color == nil { + if o == nil || isNil(o.Color) { var ret string return ret } @@ -78,15 +78,15 @@ func (o *Animal) GetColor() string { // GetColorOk returns a tuple with the Color field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Animal) GetColorOk() (*string, bool) { - if o == nil || o.Color == nil { - return nil, false + if o == nil || isNil(o.Color) { + return nil, false } return o.Color, true } // HasColor returns a boolean if a field has been set. func (o *Animal) HasColor() bool { - if o != nil && o.Color != nil { + if o != nil && !isNil(o.Color) { return true } @@ -103,7 +103,7 @@ func (o Animal) MarshalJSON() ([]byte, error) { if true { toSerialize["className"] = o.ClassName } - if o.Color != nil { + if !isNil(o.Color) { toSerialize["color"] = o.Color } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_api_response.go b/samples/client/petstore/go/go-petstore/model_api_response.go index 216600a1e38..8f585392558 100644 --- a/samples/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/client/petstore/go/go-petstore/model_api_response.go @@ -40,7 +40,7 @@ func NewApiResponseWithDefaults() *ApiResponse { // GetCode returns the Code field value if set, zero value otherwise. func (o *ApiResponse) GetCode() int32 { - if o == nil || o.Code == nil { + if o == nil || isNil(o.Code) { var ret int32 return ret } @@ -50,15 +50,15 @@ func (o *ApiResponse) GetCode() int32 { // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiResponse) GetCodeOk() (*int32, bool) { - if o == nil || o.Code == nil { - return nil, false + if o == nil || isNil(o.Code) { + return nil, false } return o.Code, true } // HasCode returns a boolean if a field has been set. func (o *ApiResponse) HasCode() bool { - if o != nil && o.Code != nil { + if o != nil && !isNil(o.Code) { return true } @@ -72,7 +72,7 @@ func (o *ApiResponse) SetCode(v int32) { // GetType returns the Type field value if set, zero value otherwise. func (o *ApiResponse) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -82,15 +82,15 @@ func (o *ApiResponse) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiResponse) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *ApiResponse) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -104,7 +104,7 @@ func (o *ApiResponse) SetType(v string) { // GetMessage returns the Message field value if set, zero value otherwise. func (o *ApiResponse) GetMessage() string { - if o == nil || o.Message == nil { + if o == nil || isNil(o.Message) { var ret string return ret } @@ -114,15 +114,15 @@ func (o *ApiResponse) GetMessage() string { // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiResponse) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false + if o == nil || isNil(o.Message) { + return nil, false } return o.Message, true } // HasMessage returns a boolean if a field has been set. func (o *ApiResponse) HasMessage() bool { - if o != nil && o.Message != nil { + if o != nil && !isNil(o.Message) { return true } @@ -136,13 +136,13 @@ func (o *ApiResponse) SetMessage(v string) { func (o ApiResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Code != nil { + if !isNil(o.Code) { toSerialize["code"] = o.Code } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["type"] = o.Type } - if o.Message != nil { + if !isNil(o.Message) { toSerialize["message"] = o.Message } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go index fc8559be8b8..1f0657d501f 100644 --- a/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go @@ -38,7 +38,7 @@ func NewArrayOfArrayOfNumberOnlyWithDefaults() *ArrayOfArrayOfNumberOnly { // GetArrayArrayNumber returns the ArrayArrayNumber field value if set, zero value otherwise. func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { - if o == nil || o.ArrayArrayNumber == nil { + if o == nil || isNil(o.ArrayArrayNumber) { var ret [][]float32 return ret } @@ -48,15 +48,15 @@ func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { // GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() ([][]float32, bool) { - if o == nil || o.ArrayArrayNumber == nil { - return nil, false + if o == nil || isNil(o.ArrayArrayNumber) { + return nil, false } return o.ArrayArrayNumber, true } // HasArrayArrayNumber returns a boolean if a field has been set. func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool { - if o != nil && o.ArrayArrayNumber != nil { + if o != nil && !isNil(o.ArrayArrayNumber) { return true } @@ -70,7 +70,7 @@ func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ArrayArrayNumber != nil { + if !isNil(o.ArrayArrayNumber) { toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_array_of_number_only.go b/samples/client/petstore/go/go-petstore/model_array_of_number_only.go index d5265a97b3d..91796160fbf 100644 --- a/samples/client/petstore/go/go-petstore/model_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_array_of_number_only.go @@ -38,7 +38,7 @@ func NewArrayOfNumberOnlyWithDefaults() *ArrayOfNumberOnly { // GetArrayNumber returns the ArrayNumber field value if set, zero value otherwise. func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { - if o == nil || o.ArrayNumber == nil { + if o == nil || isNil(o.ArrayNumber) { var ret []float32 return ret } @@ -48,15 +48,15 @@ func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { // GetArrayNumberOk returns a tuple with the ArrayNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ArrayOfNumberOnly) GetArrayNumberOk() ([]float32, bool) { - if o == nil || o.ArrayNumber == nil { - return nil, false + if o == nil || isNil(o.ArrayNumber) { + return nil, false } return o.ArrayNumber, true } // HasArrayNumber returns a boolean if a field has been set. func (o *ArrayOfNumberOnly) HasArrayNumber() bool { - if o != nil && o.ArrayNumber != nil { + if o != nil && !isNil(o.ArrayNumber) { return true } @@ -70,7 +70,7 @@ func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ArrayNumber != nil { + if !isNil(o.ArrayNumber) { toSerialize["ArrayNumber"] = o.ArrayNumber } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_array_test_.go b/samples/client/petstore/go/go-petstore/model_array_test_.go index b33b09a55db..48bb0124c2d 100644 --- a/samples/client/petstore/go/go-petstore/model_array_test_.go +++ b/samples/client/petstore/go/go-petstore/model_array_test_.go @@ -40,7 +40,7 @@ func NewArrayTestWithDefaults() *ArrayTest { // GetArrayOfString returns the ArrayOfString field value if set, zero value otherwise. func (o *ArrayTest) GetArrayOfString() []string { - if o == nil || o.ArrayOfString == nil { + if o == nil || isNil(o.ArrayOfString) { var ret []string return ret } @@ -50,15 +50,15 @@ func (o *ArrayTest) GetArrayOfString() []string { // GetArrayOfStringOk returns a tuple with the ArrayOfString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ArrayTest) GetArrayOfStringOk() ([]string, bool) { - if o == nil || o.ArrayOfString == nil { - return nil, false + if o == nil || isNil(o.ArrayOfString) { + return nil, false } return o.ArrayOfString, true } // HasArrayOfString returns a boolean if a field has been set. func (o *ArrayTest) HasArrayOfString() bool { - if o != nil && o.ArrayOfString != nil { + if o != nil && !isNil(o.ArrayOfString) { return true } @@ -72,7 +72,7 @@ func (o *ArrayTest) SetArrayOfString(v []string) { // GetArrayArrayOfInteger returns the ArrayArrayOfInteger field value if set, zero value otherwise. func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { - if o == nil || o.ArrayArrayOfInteger == nil { + if o == nil || isNil(o.ArrayArrayOfInteger) { var ret [][]int64 return ret } @@ -82,15 +82,15 @@ func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { // GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ArrayTest) GetArrayArrayOfIntegerOk() ([][]int64, bool) { - if o == nil || o.ArrayArrayOfInteger == nil { - return nil, false + if o == nil || isNil(o.ArrayArrayOfInteger) { + return nil, false } return o.ArrayArrayOfInteger, true } // HasArrayArrayOfInteger returns a boolean if a field has been set. func (o *ArrayTest) HasArrayArrayOfInteger() bool { - if o != nil && o.ArrayArrayOfInteger != nil { + if o != nil && !isNil(o.ArrayArrayOfInteger) { return true } @@ -104,7 +104,7 @@ func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64) { // GetArrayArrayOfModel returns the ArrayArrayOfModel field value if set, zero value otherwise. func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { - if o == nil || o.ArrayArrayOfModel == nil { + if o == nil || isNil(o.ArrayArrayOfModel) { var ret [][]ReadOnlyFirst return ret } @@ -114,15 +114,15 @@ func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { // GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ArrayTest) GetArrayArrayOfModelOk() ([][]ReadOnlyFirst, bool) { - if o == nil || o.ArrayArrayOfModel == nil { - return nil, false + if o == nil || isNil(o.ArrayArrayOfModel) { + return nil, false } return o.ArrayArrayOfModel, true } // HasArrayArrayOfModel returns a boolean if a field has been set. func (o *ArrayTest) HasArrayArrayOfModel() bool { - if o != nil && o.ArrayArrayOfModel != nil { + if o != nil && !isNil(o.ArrayArrayOfModel) { return true } @@ -136,13 +136,13 @@ func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { func (o ArrayTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ArrayOfString != nil { + if !isNil(o.ArrayOfString) { toSerialize["array_of_string"] = o.ArrayOfString } - if o.ArrayArrayOfInteger != nil { + if !isNil(o.ArrayArrayOfInteger) { toSerialize["array_array_of_integer"] = o.ArrayArrayOfInteger } - if o.ArrayArrayOfModel != nil { + if !isNil(o.ArrayArrayOfModel) { toSerialize["array_array_of_model"] = o.ArrayArrayOfModel } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_big_cat.go b/samples/client/petstore/go/go-petstore/model_big_cat.go index 70a5e4c76c2..e1ab343cbed 100644 --- a/samples/client/petstore/go/go-petstore/model_big_cat.go +++ b/samples/client/petstore/go/go-petstore/model_big_cat.go @@ -42,7 +42,7 @@ func NewBigCatWithDefaults() *BigCat { // GetKind returns the Kind field value if set, zero value otherwise. func (o *BigCat) GetKind() string { - if o == nil || o.Kind == nil { + if o == nil || isNil(o.Kind) { var ret string return ret } @@ -52,15 +52,15 @@ func (o *BigCat) GetKind() string { // GetKindOk returns a tuple with the Kind field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BigCat) GetKindOk() (*string, bool) { - if o == nil || o.Kind == nil { - return nil, false + if o == nil || isNil(o.Kind) { + return nil, false } return o.Kind, true } // HasKind returns a boolean if a field has been set. func (o *BigCat) HasKind() bool { - if o != nil && o.Kind != nil { + if o != nil && !isNil(o.Kind) { return true } @@ -82,7 +82,7 @@ func (o BigCat) MarshalJSON() ([]byte, error) { if errCat != nil { return []byte{}, errCat } - if o.Kind != nil { + if !isNil(o.Kind) { toSerialize["kind"] = o.Kind } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go b/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go index 4d36af2a203..ab21f0ce905 100644 --- a/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go +++ b/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go @@ -38,7 +38,7 @@ func NewBigCatAllOfWithDefaults() *BigCatAllOf { // GetKind returns the Kind field value if set, zero value otherwise. func (o *BigCatAllOf) GetKind() string { - if o == nil || o.Kind == nil { + if o == nil || isNil(o.Kind) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *BigCatAllOf) GetKind() string { // GetKindOk returns a tuple with the Kind field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BigCatAllOf) GetKindOk() (*string, bool) { - if o == nil || o.Kind == nil { - return nil, false + if o == nil || isNil(o.Kind) { + return nil, false } return o.Kind, true } // HasKind returns a boolean if a field has been set. func (o *BigCatAllOf) HasKind() bool { - if o != nil && o.Kind != nil { + if o != nil && !isNil(o.Kind) { return true } @@ -70,7 +70,7 @@ func (o *BigCatAllOf) SetKind(v string) { func (o BigCatAllOf) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Kind != nil { + if !isNil(o.Kind) { toSerialize["kind"] = o.Kind } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_capitalization.go b/samples/client/petstore/go/go-petstore/model_capitalization.go index 39d8987dd5c..f04c7c8ffb2 100644 --- a/samples/client/petstore/go/go-petstore/model_capitalization.go +++ b/samples/client/petstore/go/go-petstore/model_capitalization.go @@ -44,7 +44,7 @@ func NewCapitalizationWithDefaults() *Capitalization { // GetSmallCamel returns the SmallCamel field value if set, zero value otherwise. func (o *Capitalization) GetSmallCamel() string { - if o == nil || o.SmallCamel == nil { + if o == nil || isNil(o.SmallCamel) { var ret string return ret } @@ -54,15 +54,15 @@ func (o *Capitalization) GetSmallCamel() string { // GetSmallCamelOk returns a tuple with the SmallCamel field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetSmallCamelOk() (*string, bool) { - if o == nil || o.SmallCamel == nil { - return nil, false + if o == nil || isNil(o.SmallCamel) { + return nil, false } return o.SmallCamel, true } // HasSmallCamel returns a boolean if a field has been set. func (o *Capitalization) HasSmallCamel() bool { - if o != nil && o.SmallCamel != nil { + if o != nil && !isNil(o.SmallCamel) { return true } @@ -76,7 +76,7 @@ func (o *Capitalization) SetSmallCamel(v string) { // GetCapitalCamel returns the CapitalCamel field value if set, zero value otherwise. func (o *Capitalization) GetCapitalCamel() string { - if o == nil || o.CapitalCamel == nil { + if o == nil || isNil(o.CapitalCamel) { var ret string return ret } @@ -86,15 +86,15 @@ func (o *Capitalization) GetCapitalCamel() string { // GetCapitalCamelOk returns a tuple with the CapitalCamel field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetCapitalCamelOk() (*string, bool) { - if o == nil || o.CapitalCamel == nil { - return nil, false + if o == nil || isNil(o.CapitalCamel) { + return nil, false } return o.CapitalCamel, true } // HasCapitalCamel returns a boolean if a field has been set. func (o *Capitalization) HasCapitalCamel() bool { - if o != nil && o.CapitalCamel != nil { + if o != nil && !isNil(o.CapitalCamel) { return true } @@ -108,7 +108,7 @@ func (o *Capitalization) SetCapitalCamel(v string) { // GetSmallSnake returns the SmallSnake field value if set, zero value otherwise. func (o *Capitalization) GetSmallSnake() string { - if o == nil || o.SmallSnake == nil { + if o == nil || isNil(o.SmallSnake) { var ret string return ret } @@ -118,15 +118,15 @@ func (o *Capitalization) GetSmallSnake() string { // GetSmallSnakeOk returns a tuple with the SmallSnake field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetSmallSnakeOk() (*string, bool) { - if o == nil || o.SmallSnake == nil { - return nil, false + if o == nil || isNil(o.SmallSnake) { + return nil, false } return o.SmallSnake, true } // HasSmallSnake returns a boolean if a field has been set. func (o *Capitalization) HasSmallSnake() bool { - if o != nil && o.SmallSnake != nil { + if o != nil && !isNil(o.SmallSnake) { return true } @@ -140,7 +140,7 @@ func (o *Capitalization) SetSmallSnake(v string) { // GetCapitalSnake returns the CapitalSnake field value if set, zero value otherwise. func (o *Capitalization) GetCapitalSnake() string { - if o == nil || o.CapitalSnake == nil { + if o == nil || isNil(o.CapitalSnake) { var ret string return ret } @@ -150,15 +150,15 @@ func (o *Capitalization) GetCapitalSnake() string { // GetCapitalSnakeOk returns a tuple with the CapitalSnake field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetCapitalSnakeOk() (*string, bool) { - if o == nil || o.CapitalSnake == nil { - return nil, false + if o == nil || isNil(o.CapitalSnake) { + return nil, false } return o.CapitalSnake, true } // HasCapitalSnake returns a boolean if a field has been set. func (o *Capitalization) HasCapitalSnake() bool { - if o != nil && o.CapitalSnake != nil { + if o != nil && !isNil(o.CapitalSnake) { return true } @@ -172,7 +172,7 @@ func (o *Capitalization) SetCapitalSnake(v string) { // GetSCAETHFlowPoints returns the SCAETHFlowPoints field value if set, zero value otherwise. func (o *Capitalization) GetSCAETHFlowPoints() string { - if o == nil || o.SCAETHFlowPoints == nil { + if o == nil || isNil(o.SCAETHFlowPoints) { var ret string return ret } @@ -182,15 +182,15 @@ func (o *Capitalization) GetSCAETHFlowPoints() string { // GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetSCAETHFlowPointsOk() (*string, bool) { - if o == nil || o.SCAETHFlowPoints == nil { - return nil, false + if o == nil || isNil(o.SCAETHFlowPoints) { + return nil, false } return o.SCAETHFlowPoints, true } // HasSCAETHFlowPoints returns a boolean if a field has been set. func (o *Capitalization) HasSCAETHFlowPoints() bool { - if o != nil && o.SCAETHFlowPoints != nil { + if o != nil && !isNil(o.SCAETHFlowPoints) { return true } @@ -204,7 +204,7 @@ func (o *Capitalization) SetSCAETHFlowPoints(v string) { // GetATT_NAME returns the ATT_NAME field value if set, zero value otherwise. func (o *Capitalization) GetATT_NAME() string { - if o == nil || o.ATT_NAME == nil { + if o == nil || isNil(o.ATT_NAME) { var ret string return ret } @@ -214,15 +214,15 @@ func (o *Capitalization) GetATT_NAME() string { // GetATT_NAMEOk returns a tuple with the ATT_NAME field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetATT_NAMEOk() (*string, bool) { - if o == nil || o.ATT_NAME == nil { - return nil, false + if o == nil || isNil(o.ATT_NAME) { + return nil, false } return o.ATT_NAME, true } // HasATT_NAME returns a boolean if a field has been set. func (o *Capitalization) HasATT_NAME() bool { - if o != nil && o.ATT_NAME != nil { + if o != nil && !isNil(o.ATT_NAME) { return true } @@ -236,22 +236,22 @@ func (o *Capitalization) SetATT_NAME(v string) { func (o Capitalization) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SmallCamel != nil { + if !isNil(o.SmallCamel) { toSerialize["smallCamel"] = o.SmallCamel } - if o.CapitalCamel != nil { + if !isNil(o.CapitalCamel) { toSerialize["CapitalCamel"] = o.CapitalCamel } - if o.SmallSnake != nil { + if !isNil(o.SmallSnake) { toSerialize["small_Snake"] = o.SmallSnake } - if o.CapitalSnake != nil { + if !isNil(o.CapitalSnake) { toSerialize["Capital_Snake"] = o.CapitalSnake } - if o.SCAETHFlowPoints != nil { + if !isNil(o.SCAETHFlowPoints) { toSerialize["SCA_ETH_Flow_Points"] = o.SCAETHFlowPoints } - if o.ATT_NAME != nil { + if !isNil(o.ATT_NAME) { toSerialize["ATT_NAME"] = o.ATT_NAME } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_cat.go b/samples/client/petstore/go/go-petstore/model_cat.go index 75f71f07623..ed956db4ef6 100644 --- a/samples/client/petstore/go/go-petstore/model_cat.go +++ b/samples/client/petstore/go/go-petstore/model_cat.go @@ -42,7 +42,7 @@ func NewCatWithDefaults() *Cat { // GetDeclawed returns the Declawed field value if set, zero value otherwise. func (o *Cat) GetDeclawed() bool { - if o == nil || o.Declawed == nil { + if o == nil || isNil(o.Declawed) { var ret bool return ret } @@ -52,15 +52,15 @@ func (o *Cat) GetDeclawed() bool { // GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Cat) GetDeclawedOk() (*bool, bool) { - if o == nil || o.Declawed == nil { - return nil, false + if o == nil || isNil(o.Declawed) { + return nil, false } return o.Declawed, true } // HasDeclawed returns a boolean if a field has been set. func (o *Cat) HasDeclawed() bool { - if o != nil && o.Declawed != nil { + if o != nil && !isNil(o.Declawed) { return true } @@ -82,7 +82,7 @@ func (o Cat) MarshalJSON() ([]byte, error) { if errAnimal != nil { return []byte{}, errAnimal } - if o.Declawed != nil { + if !isNil(o.Declawed) { toSerialize["declawed"] = o.Declawed } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_cat_all_of.go b/samples/client/petstore/go/go-petstore/model_cat_all_of.go index 0a08b6b3476..2ed2d917d6f 100644 --- a/samples/client/petstore/go/go-petstore/model_cat_all_of.go +++ b/samples/client/petstore/go/go-petstore/model_cat_all_of.go @@ -38,7 +38,7 @@ func NewCatAllOfWithDefaults() *CatAllOf { // GetDeclawed returns the Declawed field value if set, zero value otherwise. func (o *CatAllOf) GetDeclawed() bool { - if o == nil || o.Declawed == nil { + if o == nil || isNil(o.Declawed) { var ret bool return ret } @@ -48,15 +48,15 @@ func (o *CatAllOf) GetDeclawed() bool { // GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CatAllOf) GetDeclawedOk() (*bool, bool) { - if o == nil || o.Declawed == nil { - return nil, false + if o == nil || isNil(o.Declawed) { + return nil, false } return o.Declawed, true } // HasDeclawed returns a boolean if a field has been set. func (o *CatAllOf) HasDeclawed() bool { - if o != nil && o.Declawed != nil { + if o != nil && !isNil(o.Declawed) { return true } @@ -70,7 +70,7 @@ func (o *CatAllOf) SetDeclawed(v bool) { func (o CatAllOf) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Declawed != nil { + if !isNil(o.Declawed) { toSerialize["declawed"] = o.Declawed } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_category.go b/samples/client/petstore/go/go-petstore/model_category.go index 601de584fde..5604617d913 100644 --- a/samples/client/petstore/go/go-petstore/model_category.go +++ b/samples/client/petstore/go/go-petstore/model_category.go @@ -42,7 +42,7 @@ func NewCategoryWithDefaults() *Category { // GetId returns the Id field value if set, zero value otherwise. func (o *Category) GetId() int64 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int64 return ret } @@ -52,15 +52,15 @@ func (o *Category) GetId() int64 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Category) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *Category) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -86,7 +86,7 @@ func (o *Category) GetName() string { // and a boolean to check if the value has been set. func (o *Category) GetNameOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Name, true } @@ -98,7 +98,7 @@ func (o *Category) SetName(v string) { func (o Category) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !isNil(o.Id) { toSerialize["id"] = o.Id } if true { diff --git a/samples/client/petstore/go/go-petstore/model_class_model.go b/samples/client/petstore/go/go-petstore/model_class_model.go index b1d328e883f..2a0321a8b86 100644 --- a/samples/client/petstore/go/go-petstore/model_class_model.go +++ b/samples/client/petstore/go/go-petstore/model_class_model.go @@ -38,7 +38,7 @@ func NewClassModelWithDefaults() *ClassModel { // GetClass returns the Class field value if set, zero value otherwise. func (o *ClassModel) GetClass() string { - if o == nil || o.Class == nil { + if o == nil || isNil(o.Class) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *ClassModel) GetClass() string { // GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ClassModel) GetClassOk() (*string, bool) { - if o == nil || o.Class == nil { - return nil, false + if o == nil || isNil(o.Class) { + return nil, false } return o.Class, true } // HasClass returns a boolean if a field has been set. func (o *ClassModel) HasClass() bool { - if o != nil && o.Class != nil { + if o != nil && !isNil(o.Class) { return true } @@ -70,7 +70,7 @@ func (o *ClassModel) SetClass(v string) { func (o ClassModel) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Class != nil { + if !isNil(o.Class) { toSerialize["_class"] = o.Class } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_client.go b/samples/client/petstore/go/go-petstore/model_client.go index 0a441819fe1..d975f74a5f3 100644 --- a/samples/client/petstore/go/go-petstore/model_client.go +++ b/samples/client/petstore/go/go-petstore/model_client.go @@ -38,7 +38,7 @@ func NewClientWithDefaults() *Client { // GetClient returns the Client field value if set, zero value otherwise. func (o *Client) GetClient() string { - if o == nil || o.Client == nil { + if o == nil || isNil(o.Client) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *Client) GetClient() string { // GetClientOk returns a tuple with the Client field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Client) GetClientOk() (*string, bool) { - if o == nil || o.Client == nil { - return nil, false + if o == nil || isNil(o.Client) { + return nil, false } return o.Client, true } // HasClient returns a boolean if a field has been set. func (o *Client) HasClient() bool { - if o != nil && o.Client != nil { + if o != nil && !isNil(o.Client) { return true } @@ -70,7 +70,7 @@ func (o *Client) SetClient(v string) { func (o Client) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Client != nil { + if !isNil(o.Client) { toSerialize["client"] = o.Client } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_dog.go b/samples/client/petstore/go/go-petstore/model_dog.go index 526597b6a66..d3d615a3b67 100644 --- a/samples/client/petstore/go/go-petstore/model_dog.go +++ b/samples/client/petstore/go/go-petstore/model_dog.go @@ -42,7 +42,7 @@ func NewDogWithDefaults() *Dog { // GetBreed returns the Breed field value if set, zero value otherwise. func (o *Dog) GetBreed() string { - if o == nil || o.Breed == nil { + if o == nil || isNil(o.Breed) { var ret string return ret } @@ -52,15 +52,15 @@ func (o *Dog) GetBreed() string { // GetBreedOk returns a tuple with the Breed field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Dog) GetBreedOk() (*string, bool) { - if o == nil || o.Breed == nil { - return nil, false + if o == nil || isNil(o.Breed) { + return nil, false } return o.Breed, true } // HasBreed returns a boolean if a field has been set. func (o *Dog) HasBreed() bool { - if o != nil && o.Breed != nil { + if o != nil && !isNil(o.Breed) { return true } @@ -82,7 +82,7 @@ func (o Dog) MarshalJSON() ([]byte, error) { if errAnimal != nil { return []byte{}, errAnimal } - if o.Breed != nil { + if !isNil(o.Breed) { toSerialize["breed"] = o.Breed } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_dog_all_of.go b/samples/client/petstore/go/go-petstore/model_dog_all_of.go index b73240b7cce..5e6ee65d837 100644 --- a/samples/client/petstore/go/go-petstore/model_dog_all_of.go +++ b/samples/client/petstore/go/go-petstore/model_dog_all_of.go @@ -38,7 +38,7 @@ func NewDogAllOfWithDefaults() *DogAllOf { // GetBreed returns the Breed field value if set, zero value otherwise. func (o *DogAllOf) GetBreed() string { - if o == nil || o.Breed == nil { + if o == nil || isNil(o.Breed) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *DogAllOf) GetBreed() string { // GetBreedOk returns a tuple with the Breed field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DogAllOf) GetBreedOk() (*string, bool) { - if o == nil || o.Breed == nil { - return nil, false + if o == nil || isNil(o.Breed) { + return nil, false } return o.Breed, true } // HasBreed returns a boolean if a field has been set. func (o *DogAllOf) HasBreed() bool { - if o != nil && o.Breed != nil { + if o != nil && !isNil(o.Breed) { return true } @@ -70,7 +70,7 @@ func (o *DogAllOf) SetBreed(v string) { func (o DogAllOf) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Breed != nil { + if !isNil(o.Breed) { toSerialize["breed"] = o.Breed } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_enum_arrays.go b/samples/client/petstore/go/go-petstore/model_enum_arrays.go index 19dc8bc8e98..fb8f5c0c48f 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_arrays.go +++ b/samples/client/petstore/go/go-petstore/model_enum_arrays.go @@ -39,7 +39,7 @@ func NewEnumArraysWithDefaults() *EnumArrays { // GetJustSymbol returns the JustSymbol field value if set, zero value otherwise. func (o *EnumArrays) GetJustSymbol() string { - if o == nil || o.JustSymbol == nil { + if o == nil || isNil(o.JustSymbol) { var ret string return ret } @@ -49,15 +49,15 @@ func (o *EnumArrays) GetJustSymbol() string { // GetJustSymbolOk returns a tuple with the JustSymbol field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumArrays) GetJustSymbolOk() (*string, bool) { - if o == nil || o.JustSymbol == nil { - return nil, false + if o == nil || isNil(o.JustSymbol) { + return nil, false } return o.JustSymbol, true } // HasJustSymbol returns a boolean if a field has been set. func (o *EnumArrays) HasJustSymbol() bool { - if o != nil && o.JustSymbol != nil { + if o != nil && !isNil(o.JustSymbol) { return true } @@ -71,7 +71,7 @@ func (o *EnumArrays) SetJustSymbol(v string) { // GetArrayEnum returns the ArrayEnum field value if set, zero value otherwise. func (o *EnumArrays) GetArrayEnum() []string { - if o == nil || o.ArrayEnum == nil { + if o == nil || isNil(o.ArrayEnum) { var ret []string return ret } @@ -81,15 +81,15 @@ func (o *EnumArrays) GetArrayEnum() []string { // GetArrayEnumOk returns a tuple with the ArrayEnum field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumArrays) GetArrayEnumOk() ([]string, bool) { - if o == nil || o.ArrayEnum == nil { - return nil, false + if o == nil || isNil(o.ArrayEnum) { + return nil, false } return o.ArrayEnum, true } // HasArrayEnum returns a boolean if a field has been set. func (o *EnumArrays) HasArrayEnum() bool { - if o != nil && o.ArrayEnum != nil { + if o != nil && !isNil(o.ArrayEnum) { return true } @@ -103,10 +103,10 @@ func (o *EnumArrays) SetArrayEnum(v []string) { func (o EnumArrays) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.JustSymbol != nil { + if !isNil(o.JustSymbol) { toSerialize["just_symbol"] = o.JustSymbol } - if o.ArrayEnum != nil { + if !isNil(o.ArrayEnum) { toSerialize["array_enum"] = o.ArrayEnum } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_enum_test_.go b/samples/client/petstore/go/go-petstore/model_enum_test_.go index 37a02ad010c..3daa3c62be9 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/client/petstore/go/go-petstore/model_enum_test_.go @@ -43,7 +43,7 @@ func NewEnumTestWithDefaults() *EnumTest { // GetEnumString returns the EnumString field value if set, zero value otherwise. func (o *EnumTest) GetEnumString() string { - if o == nil || o.EnumString == nil { + if o == nil || isNil(o.EnumString) { var ret string return ret } @@ -53,15 +53,15 @@ func (o *EnumTest) GetEnumString() string { // GetEnumStringOk returns a tuple with the EnumString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumTest) GetEnumStringOk() (*string, bool) { - if o == nil || o.EnumString == nil { - return nil, false + if o == nil || isNil(o.EnumString) { + return nil, false } return o.EnumString, true } // HasEnumString returns a boolean if a field has been set. func (o *EnumTest) HasEnumString() bool { - if o != nil && o.EnumString != nil { + if o != nil && !isNil(o.EnumString) { return true } @@ -87,7 +87,7 @@ func (o *EnumTest) GetEnumStringRequired() string { // and a boolean to check if the value has been set. func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.EnumStringRequired, true } @@ -99,7 +99,7 @@ func (o *EnumTest) SetEnumStringRequired(v string) { // GetEnumInteger returns the EnumInteger field value if set, zero value otherwise. func (o *EnumTest) GetEnumInteger() int32 { - if o == nil || o.EnumInteger == nil { + if o == nil || isNil(o.EnumInteger) { var ret int32 return ret } @@ -109,15 +109,15 @@ func (o *EnumTest) GetEnumInteger() int32 { // GetEnumIntegerOk returns a tuple with the EnumInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumTest) GetEnumIntegerOk() (*int32, bool) { - if o == nil || o.EnumInteger == nil { - return nil, false + if o == nil || isNil(o.EnumInteger) { + return nil, false } return o.EnumInteger, true } // HasEnumInteger returns a boolean if a field has been set. func (o *EnumTest) HasEnumInteger() bool { - if o != nil && o.EnumInteger != nil { + if o != nil && !isNil(o.EnumInteger) { return true } @@ -131,7 +131,7 @@ func (o *EnumTest) SetEnumInteger(v int32) { // GetEnumNumber returns the EnumNumber field value if set, zero value otherwise. func (o *EnumTest) GetEnumNumber() float64 { - if o == nil || o.EnumNumber == nil { + if o == nil || isNil(o.EnumNumber) { var ret float64 return ret } @@ -141,15 +141,15 @@ func (o *EnumTest) GetEnumNumber() float64 { // GetEnumNumberOk returns a tuple with the EnumNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumTest) GetEnumNumberOk() (*float64, bool) { - if o == nil || o.EnumNumber == nil { - return nil, false + if o == nil || isNil(o.EnumNumber) { + return nil, false } return o.EnumNumber, true } // HasEnumNumber returns a boolean if a field has been set. func (o *EnumTest) HasEnumNumber() bool { - if o != nil && o.EnumNumber != nil { + if o != nil && !isNil(o.EnumNumber) { return true } @@ -163,7 +163,7 @@ func (o *EnumTest) SetEnumNumber(v float64) { // GetOuterEnum returns the OuterEnum field value if set, zero value otherwise. func (o *EnumTest) GetOuterEnum() OuterEnum { - if o == nil || o.OuterEnum == nil { + if o == nil || isNil(o.OuterEnum) { var ret OuterEnum return ret } @@ -173,15 +173,15 @@ func (o *EnumTest) GetOuterEnum() OuterEnum { // GetOuterEnumOk returns a tuple with the OuterEnum field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool) { - if o == nil || o.OuterEnum == nil { - return nil, false + if o == nil || isNil(o.OuterEnum) { + return nil, false } return o.OuterEnum, true } // HasOuterEnum returns a boolean if a field has been set. func (o *EnumTest) HasOuterEnum() bool { - if o != nil && o.OuterEnum != nil { + if o != nil && !isNil(o.OuterEnum) { return true } @@ -195,19 +195,19 @@ func (o *EnumTest) SetOuterEnum(v OuterEnum) { func (o EnumTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.EnumString != nil { + if !isNil(o.EnumString) { toSerialize["enum_string"] = o.EnumString } if true { toSerialize["enum_string_required"] = o.EnumStringRequired } - if o.EnumInteger != nil { + if !isNil(o.EnumInteger) { toSerialize["enum_integer"] = o.EnumInteger } - if o.EnumNumber != nil { + if !isNil(o.EnumNumber) { toSerialize["enum_number"] = o.EnumNumber } - if o.OuterEnum != nil { + if !isNil(o.OuterEnum) { toSerialize["outerEnum"] = o.OuterEnum } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_file.go b/samples/client/petstore/go/go-petstore/model_file.go index 54a580b87ea..900282eb6f0 100644 --- a/samples/client/petstore/go/go-petstore/model_file.go +++ b/samples/client/petstore/go/go-petstore/model_file.go @@ -39,7 +39,7 @@ func NewFileWithDefaults() *File { // GetSourceURI returns the SourceURI field value if set, zero value otherwise. func (o *File) GetSourceURI() string { - if o == nil || o.SourceURI == nil { + if o == nil || isNil(o.SourceURI) { var ret string return ret } @@ -49,15 +49,15 @@ func (o *File) GetSourceURI() string { // GetSourceURIOk returns a tuple with the SourceURI field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *File) GetSourceURIOk() (*string, bool) { - if o == nil || o.SourceURI == nil { - return nil, false + if o == nil || isNil(o.SourceURI) { + return nil, false } return o.SourceURI, true } // HasSourceURI returns a boolean if a field has been set. func (o *File) HasSourceURI() bool { - if o != nil && o.SourceURI != nil { + if o != nil && !isNil(o.SourceURI) { return true } @@ -71,7 +71,7 @@ func (o *File) SetSourceURI(v string) { func (o File) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SourceURI != nil { + if !isNil(o.SourceURI) { toSerialize["sourceURI"] = o.SourceURI } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go b/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go index 52dcf0e1e9f..bdca1597b4d 100644 --- a/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go +++ b/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go @@ -39,7 +39,7 @@ func NewFileSchemaTestClassWithDefaults() *FileSchemaTestClass { // GetFile returns the File field value if set, zero value otherwise. func (o *FileSchemaTestClass) GetFile() File { - if o == nil || o.File == nil { + if o == nil || isNil(o.File) { var ret File return ret } @@ -49,15 +49,15 @@ func (o *FileSchemaTestClass) GetFile() File { // GetFileOk returns a tuple with the File field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FileSchemaTestClass) GetFileOk() (*File, bool) { - if o == nil || o.File == nil { - return nil, false + if o == nil || isNil(o.File) { + return nil, false } return o.File, true } // HasFile returns a boolean if a field has been set. func (o *FileSchemaTestClass) HasFile() bool { - if o != nil && o.File != nil { + if o != nil && !isNil(o.File) { return true } @@ -71,7 +71,7 @@ func (o *FileSchemaTestClass) SetFile(v File) { // GetFiles returns the Files field value if set, zero value otherwise. func (o *FileSchemaTestClass) GetFiles() []File { - if o == nil || o.Files == nil { + if o == nil || isNil(o.Files) { var ret []File return ret } @@ -81,15 +81,15 @@ func (o *FileSchemaTestClass) GetFiles() []File { // GetFilesOk returns a tuple with the Files field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FileSchemaTestClass) GetFilesOk() ([]File, bool) { - if o == nil || o.Files == nil { - return nil, false + if o == nil || isNil(o.Files) { + return nil, false } return o.Files, true } // HasFiles returns a boolean if a field has been set. func (o *FileSchemaTestClass) HasFiles() bool { - if o != nil && o.Files != nil { + if o != nil && !isNil(o.Files) { return true } @@ -103,10 +103,10 @@ func (o *FileSchemaTestClass) SetFiles(v []File) { func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.File != nil { + if !isNil(o.File) { toSerialize["file"] = o.File } - if o.Files != nil { + if !isNil(o.Files) { toSerialize["files"] = o.Files } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_format_test_.go b/samples/client/petstore/go/go-petstore/model_format_test_.go index 248d8c124f2..a8484f5ac34 100644 --- a/samples/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/client/petstore/go/go-petstore/model_format_test_.go @@ -57,7 +57,7 @@ func NewFormatTestWithDefaults() *FormatTest { // GetInteger returns the Integer field value if set, zero value otherwise. func (o *FormatTest) GetInteger() int32 { - if o == nil || o.Integer == nil { + if o == nil || isNil(o.Integer) { var ret int32 return ret } @@ -67,15 +67,15 @@ func (o *FormatTest) GetInteger() int32 { // GetIntegerOk returns a tuple with the Integer field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetIntegerOk() (*int32, bool) { - if o == nil || o.Integer == nil { - return nil, false + if o == nil || isNil(o.Integer) { + return nil, false } return o.Integer, true } // HasInteger returns a boolean if a field has been set. func (o *FormatTest) HasInteger() bool { - if o != nil && o.Integer != nil { + if o != nil && !isNil(o.Integer) { return true } @@ -89,7 +89,7 @@ func (o *FormatTest) SetInteger(v int32) { // GetInt32 returns the Int32 field value if set, zero value otherwise. func (o *FormatTest) GetInt32() int32 { - if o == nil || o.Int32 == nil { + if o == nil || isNil(o.Int32) { var ret int32 return ret } @@ -99,15 +99,15 @@ func (o *FormatTest) GetInt32() int32 { // GetInt32Ok returns a tuple with the Int32 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetInt32Ok() (*int32, bool) { - if o == nil || o.Int32 == nil { - return nil, false + if o == nil || isNil(o.Int32) { + return nil, false } return o.Int32, true } // HasInt32 returns a boolean if a field has been set. func (o *FormatTest) HasInt32() bool { - if o != nil && o.Int32 != nil { + if o != nil && !isNil(o.Int32) { return true } @@ -121,7 +121,7 @@ func (o *FormatTest) SetInt32(v int32) { // GetInt64 returns the Int64 field value if set, zero value otherwise. func (o *FormatTest) GetInt64() int64 { - if o == nil || o.Int64 == nil { + if o == nil || isNil(o.Int64) { var ret int64 return ret } @@ -131,15 +131,15 @@ func (o *FormatTest) GetInt64() int64 { // GetInt64Ok returns a tuple with the Int64 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetInt64Ok() (*int64, bool) { - if o == nil || o.Int64 == nil { - return nil, false + if o == nil || isNil(o.Int64) { + return nil, false } return o.Int64, true } // HasInt64 returns a boolean if a field has been set. func (o *FormatTest) HasInt64() bool { - if o != nil && o.Int64 != nil { + if o != nil && !isNil(o.Int64) { return true } @@ -165,7 +165,7 @@ func (o *FormatTest) GetNumber() float32 { // and a boolean to check if the value has been set. func (o *FormatTest) GetNumberOk() (*float32, bool) { if o == nil { - return nil, false + return nil, false } return &o.Number, true } @@ -177,7 +177,7 @@ func (o *FormatTest) SetNumber(v float32) { // GetFloat returns the Float field value if set, zero value otherwise. func (o *FormatTest) GetFloat() float32 { - if o == nil || o.Float == nil { + if o == nil || isNil(o.Float) { var ret float32 return ret } @@ -187,15 +187,15 @@ func (o *FormatTest) GetFloat() float32 { // GetFloatOk returns a tuple with the Float field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetFloatOk() (*float32, bool) { - if o == nil || o.Float == nil { - return nil, false + if o == nil || isNil(o.Float) { + return nil, false } return o.Float, true } // HasFloat returns a boolean if a field has been set. func (o *FormatTest) HasFloat() bool { - if o != nil && o.Float != nil { + if o != nil && !isNil(o.Float) { return true } @@ -209,7 +209,7 @@ func (o *FormatTest) SetFloat(v float32) { // GetDouble returns the Double field value if set, zero value otherwise. func (o *FormatTest) GetDouble() float64 { - if o == nil || o.Double == nil { + if o == nil || isNil(o.Double) { var ret float64 return ret } @@ -219,15 +219,15 @@ func (o *FormatTest) GetDouble() float64 { // GetDoubleOk returns a tuple with the Double field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetDoubleOk() (*float64, bool) { - if o == nil || o.Double == nil { - return nil, false + if o == nil || isNil(o.Double) { + return nil, false } return o.Double, true } // HasDouble returns a boolean if a field has been set. func (o *FormatTest) HasDouble() bool { - if o != nil && o.Double != nil { + if o != nil && !isNil(o.Double) { return true } @@ -241,7 +241,7 @@ func (o *FormatTest) SetDouble(v float64) { // GetString returns the String field value if set, zero value otherwise. func (o *FormatTest) GetString() string { - if o == nil || o.String == nil { + if o == nil || isNil(o.String) { var ret string return ret } @@ -251,15 +251,15 @@ func (o *FormatTest) GetString() string { // GetStringOk returns a tuple with the String field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetStringOk() (*string, bool) { - if o == nil || o.String == nil { - return nil, false + if o == nil || isNil(o.String) { + return nil, false } return o.String, true } // HasString returns a boolean if a field has been set. func (o *FormatTest) HasString() bool { - if o != nil && o.String != nil { + if o != nil && !isNil(o.String) { return true } @@ -285,7 +285,7 @@ func (o *FormatTest) GetByte() string { // and a boolean to check if the value has been set. func (o *FormatTest) GetByteOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Byte, true } @@ -297,7 +297,7 @@ func (o *FormatTest) SetByte(v string) { // GetBinary returns the Binary field value if set, zero value otherwise. func (o *FormatTest) GetBinary() *os.File { - if o == nil || o.Binary == nil { + if o == nil || isNil(o.Binary) { var ret *os.File return ret } @@ -307,15 +307,15 @@ func (o *FormatTest) GetBinary() *os.File { // GetBinaryOk returns a tuple with the Binary field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetBinaryOk() (**os.File, bool) { - if o == nil || o.Binary == nil { - return nil, false + if o == nil || isNil(o.Binary) { + return nil, false } return o.Binary, true } // HasBinary returns a boolean if a field has been set. func (o *FormatTest) HasBinary() bool { - if o != nil && o.Binary != nil { + if o != nil && !isNil(o.Binary) { return true } @@ -341,7 +341,7 @@ func (o *FormatTest) GetDate() string { // and a boolean to check if the value has been set. func (o *FormatTest) GetDateOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Date, true } @@ -353,7 +353,7 @@ func (o *FormatTest) SetDate(v string) { // GetDateTime returns the DateTime field value if set, zero value otherwise. func (o *FormatTest) GetDateTime() time.Time { - if o == nil || o.DateTime == nil { + if o == nil || isNil(o.DateTime) { var ret time.Time return ret } @@ -363,15 +363,15 @@ func (o *FormatTest) GetDateTime() time.Time { // GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetDateTimeOk() (*time.Time, bool) { - if o == nil || o.DateTime == nil { - return nil, false + if o == nil || isNil(o.DateTime) { + return nil, false } return o.DateTime, true } // HasDateTime returns a boolean if a field has been set. func (o *FormatTest) HasDateTime() bool { - if o != nil && o.DateTime != nil { + if o != nil && !isNil(o.DateTime) { return true } @@ -385,7 +385,7 @@ func (o *FormatTest) SetDateTime(v time.Time) { // GetUuid returns the Uuid field value if set, zero value otherwise. func (o *FormatTest) GetUuid() string { - if o == nil || o.Uuid == nil { + if o == nil || isNil(o.Uuid) { var ret string return ret } @@ -395,15 +395,15 @@ func (o *FormatTest) GetUuid() string { // GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetUuidOk() (*string, bool) { - if o == nil || o.Uuid == nil { - return nil, false + if o == nil || isNil(o.Uuid) { + return nil, false } return o.Uuid, true } // HasUuid returns a boolean if a field has been set. func (o *FormatTest) HasUuid() bool { - if o != nil && o.Uuid != nil { + if o != nil && !isNil(o.Uuid) { return true } @@ -429,7 +429,7 @@ func (o *FormatTest) GetPassword() string { // and a boolean to check if the value has been set. func (o *FormatTest) GetPasswordOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Password, true } @@ -441,7 +441,7 @@ func (o *FormatTest) SetPassword(v string) { // GetBigDecimal returns the BigDecimal field value if set, zero value otherwise. func (o *FormatTest) GetBigDecimal() float64 { - if o == nil || o.BigDecimal == nil { + if o == nil || isNil(o.BigDecimal) { var ret float64 return ret } @@ -451,15 +451,15 @@ func (o *FormatTest) GetBigDecimal() float64 { // GetBigDecimalOk returns a tuple with the BigDecimal field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetBigDecimalOk() (*float64, bool) { - if o == nil || o.BigDecimal == nil { - return nil, false + if o == nil || isNil(o.BigDecimal) { + return nil, false } return o.BigDecimal, true } // HasBigDecimal returns a boolean if a field has been set. func (o *FormatTest) HasBigDecimal() bool { - if o != nil && o.BigDecimal != nil { + if o != nil && !isNil(o.BigDecimal) { return true } @@ -473,46 +473,46 @@ func (o *FormatTest) SetBigDecimal(v float64) { func (o FormatTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Integer != nil { + if !isNil(o.Integer) { toSerialize["integer"] = o.Integer } - if o.Int32 != nil { + if !isNil(o.Int32) { toSerialize["int32"] = o.Int32 } - if o.Int64 != nil { + if !isNil(o.Int64) { toSerialize["int64"] = o.Int64 } if true { toSerialize["number"] = o.Number } - if o.Float != nil { + if !isNil(o.Float) { toSerialize["float"] = o.Float } - if o.Double != nil { + if !isNil(o.Double) { toSerialize["double"] = o.Double } - if o.String != nil { + if !isNil(o.String) { toSerialize["string"] = o.String } if true { toSerialize["byte"] = o.Byte } - if o.Binary != nil { + if !isNil(o.Binary) { toSerialize["binary"] = o.Binary } if true { toSerialize["date"] = o.Date } - if o.DateTime != nil { + if !isNil(o.DateTime) { toSerialize["dateTime"] = o.DateTime } - if o.Uuid != nil { + if !isNil(o.Uuid) { toSerialize["uuid"] = o.Uuid } if true { toSerialize["password"] = o.Password } - if o.BigDecimal != nil { + if !isNil(o.BigDecimal) { toSerialize["BigDecimal"] = o.BigDecimal } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_has_only_read_only.go b/samples/client/petstore/go/go-petstore/model_has_only_read_only.go index 364faf15a4d..b197ab04e30 100644 --- a/samples/client/petstore/go/go-petstore/model_has_only_read_only.go +++ b/samples/client/petstore/go/go-petstore/model_has_only_read_only.go @@ -39,7 +39,7 @@ func NewHasOnlyReadOnlyWithDefaults() *HasOnlyReadOnly { // GetBar returns the Bar field value if set, zero value otherwise. func (o *HasOnlyReadOnly) GetBar() string { - if o == nil || o.Bar == nil { + if o == nil || isNil(o.Bar) { var ret string return ret } @@ -49,15 +49,15 @@ func (o *HasOnlyReadOnly) GetBar() string { // GetBarOk returns a tuple with the Bar field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HasOnlyReadOnly) GetBarOk() (*string, bool) { - if o == nil || o.Bar == nil { - return nil, false + if o == nil || isNil(o.Bar) { + return nil, false } return o.Bar, true } // HasBar returns a boolean if a field has been set. func (o *HasOnlyReadOnly) HasBar() bool { - if o != nil && o.Bar != nil { + if o != nil && !isNil(o.Bar) { return true } @@ -71,7 +71,7 @@ func (o *HasOnlyReadOnly) SetBar(v string) { // GetFoo returns the Foo field value if set, zero value otherwise. func (o *HasOnlyReadOnly) GetFoo() string { - if o == nil || o.Foo == nil { + if o == nil || isNil(o.Foo) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *HasOnlyReadOnly) GetFoo() string { // GetFooOk returns a tuple with the Foo field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HasOnlyReadOnly) GetFooOk() (*string, bool) { - if o == nil || o.Foo == nil { - return nil, false + if o == nil || isNil(o.Foo) { + return nil, false } return o.Foo, true } // HasFoo returns a boolean if a field has been set. func (o *HasOnlyReadOnly) HasFoo() bool { - if o != nil && o.Foo != nil { + if o != nil && !isNil(o.Foo) { return true } @@ -103,10 +103,10 @@ func (o *HasOnlyReadOnly) SetFoo(v string) { func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Bar != nil { + if !isNil(o.Bar) { toSerialize["bar"] = o.Bar } - if o.Foo != nil { + if !isNil(o.Foo) { toSerialize["foo"] = o.Foo } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_list.go b/samples/client/petstore/go/go-petstore/model_list.go index 75487f7b030..ee55ad221f7 100644 --- a/samples/client/petstore/go/go-petstore/model_list.go +++ b/samples/client/petstore/go/go-petstore/model_list.go @@ -38,7 +38,7 @@ func NewListWithDefaults() *List { // GetVar123List returns the Var123List field value if set, zero value otherwise. func (o *List) GetVar123List() string { - if o == nil || o.Var123List == nil { + if o == nil || isNil(o.Var123List) { var ret string return ret } @@ -48,15 +48,15 @@ func (o *List) GetVar123List() string { // GetVar123ListOk returns a tuple with the Var123List field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *List) GetVar123ListOk() (*string, bool) { - if o == nil || o.Var123List == nil { - return nil, false + if o == nil || isNil(o.Var123List) { + return nil, false } return o.Var123List, true } // HasVar123List returns a boolean if a field has been set. func (o *List) HasVar123List() bool { - if o != nil && o.Var123List != nil { + if o != nil && !isNil(o.Var123List) { return true } @@ -70,7 +70,7 @@ func (o *List) SetVar123List(v string) { func (o List) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Var123List != nil { + if !isNil(o.Var123List) { toSerialize["123-list"] = o.Var123List } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_map_test_.go b/samples/client/petstore/go/go-petstore/model_map_test_.go index 71e56a27d89..5fa142fe20c 100644 --- a/samples/client/petstore/go/go-petstore/model_map_test_.go +++ b/samples/client/petstore/go/go-petstore/model_map_test_.go @@ -41,7 +41,7 @@ func NewMapTestWithDefaults() *MapTest { // GetMapMapOfString returns the MapMapOfString field value if set, zero value otherwise. func (o *MapTest) GetMapMapOfString() map[string]map[string]string { - if o == nil || o.MapMapOfString == nil { + if o == nil || isNil(o.MapMapOfString) { var ret map[string]map[string]string return ret } @@ -51,15 +51,15 @@ func (o *MapTest) GetMapMapOfString() map[string]map[string]string { // GetMapMapOfStringOk returns a tuple with the MapMapOfString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MapTest) GetMapMapOfStringOk() (*map[string]map[string]string, bool) { - if o == nil || o.MapMapOfString == nil { - return nil, false + if o == nil || isNil(o.MapMapOfString) { + return nil, false } return o.MapMapOfString, true } // HasMapMapOfString returns a boolean if a field has been set. func (o *MapTest) HasMapMapOfString() bool { - if o != nil && o.MapMapOfString != nil { + if o != nil && !isNil(o.MapMapOfString) { return true } @@ -73,7 +73,7 @@ func (o *MapTest) SetMapMapOfString(v map[string]map[string]string) { // GetMapOfEnumString returns the MapOfEnumString field value if set, zero value otherwise. func (o *MapTest) GetMapOfEnumString() map[string]string { - if o == nil || o.MapOfEnumString == nil { + if o == nil || isNil(o.MapOfEnumString) { var ret map[string]string return ret } @@ -83,15 +83,15 @@ func (o *MapTest) GetMapOfEnumString() map[string]string { // GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MapTest) GetMapOfEnumStringOk() (*map[string]string, bool) { - if o == nil || o.MapOfEnumString == nil { - return nil, false + if o == nil || isNil(o.MapOfEnumString) { + return nil, false } return o.MapOfEnumString, true } // HasMapOfEnumString returns a boolean if a field has been set. func (o *MapTest) HasMapOfEnumString() bool { - if o != nil && o.MapOfEnumString != nil { + if o != nil && !isNil(o.MapOfEnumString) { return true } @@ -105,7 +105,7 @@ func (o *MapTest) SetMapOfEnumString(v map[string]string) { // GetDirectMap returns the DirectMap field value if set, zero value otherwise. func (o *MapTest) GetDirectMap() map[string]bool { - if o == nil || o.DirectMap == nil { + if o == nil || isNil(o.DirectMap) { var ret map[string]bool return ret } @@ -115,15 +115,15 @@ func (o *MapTest) GetDirectMap() map[string]bool { // GetDirectMapOk returns a tuple with the DirectMap field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MapTest) GetDirectMapOk() (*map[string]bool, bool) { - if o == nil || o.DirectMap == nil { - return nil, false + if o == nil || isNil(o.DirectMap) { + return nil, false } return o.DirectMap, true } // HasDirectMap returns a boolean if a field has been set. func (o *MapTest) HasDirectMap() bool { - if o != nil && o.DirectMap != nil { + if o != nil && !isNil(o.DirectMap) { return true } @@ -137,7 +137,7 @@ func (o *MapTest) SetDirectMap(v map[string]bool) { // GetIndirectMap returns the IndirectMap field value if set, zero value otherwise. func (o *MapTest) GetIndirectMap() map[string]bool { - if o == nil || o.IndirectMap == nil { + if o == nil || isNil(o.IndirectMap) { var ret map[string]bool return ret } @@ -147,15 +147,15 @@ func (o *MapTest) GetIndirectMap() map[string]bool { // GetIndirectMapOk returns a tuple with the IndirectMap field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MapTest) GetIndirectMapOk() (*map[string]bool, bool) { - if o == nil || o.IndirectMap == nil { - return nil, false + if o == nil || isNil(o.IndirectMap) { + return nil, false } return o.IndirectMap, true } // HasIndirectMap returns a boolean if a field has been set. func (o *MapTest) HasIndirectMap() bool { - if o != nil && o.IndirectMap != nil { + if o != nil && !isNil(o.IndirectMap) { return true } @@ -169,16 +169,16 @@ func (o *MapTest) SetIndirectMap(v map[string]bool) { func (o MapTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MapMapOfString != nil { + if !isNil(o.MapMapOfString) { toSerialize["map_map_of_string"] = o.MapMapOfString } - if o.MapOfEnumString != nil { + if !isNil(o.MapOfEnumString) { toSerialize["map_of_enum_string"] = o.MapOfEnumString } - if o.DirectMap != nil { + if !isNil(o.DirectMap) { toSerialize["direct_map"] = o.DirectMap } - if o.IndirectMap != nil { + if !isNil(o.IndirectMap) { toSerialize["indirect_map"] = o.IndirectMap } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go index 3d2a9b1dcaf..b56557d28a0 100644 --- a/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -41,7 +41,7 @@ func NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults() *MixedProperti // GetUuid returns the Uuid field value if set, zero value otherwise. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string { - if o == nil || o.Uuid == nil { + if o == nil || isNil(o.Uuid) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string { // GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (*string, bool) { - if o == nil || o.Uuid == nil { - return nil, false + if o == nil || isNil(o.Uuid) { + return nil, false } return o.Uuid, true } // HasUuid returns a boolean if a field has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool { - if o != nil && o.Uuid != nil { + if o != nil && !isNil(o.Uuid) { return true } @@ -73,7 +73,7 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string) { // GetDateTime returns the DateTime field value if set, zero value otherwise. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time { - if o == nil || o.DateTime == nil { + if o == nil || isNil(o.DateTime) { var ret time.Time return ret } @@ -83,15 +83,15 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time { // GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (*time.Time, bool) { - if o == nil || o.DateTime == nil { - return nil, false + if o == nil || isNil(o.DateTime) { + return nil, false } return o.DateTime, true } // HasDateTime returns a boolean if a field has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool { - if o != nil && o.DateTime != nil { + if o != nil && !isNil(o.DateTime) { return true } @@ -105,7 +105,7 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time) { // GetMap returns the Map field value if set, zero value otherwise. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal { - if o == nil || o.Map == nil { + if o == nil || isNil(o.Map) { var ret map[string]Animal return ret } @@ -115,15 +115,15 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal // GetMapOk returns a tuple with the Map field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (*map[string]Animal, bool) { - if o == nil || o.Map == nil { - return nil, false + if o == nil || isNil(o.Map) { + return nil, false } return o.Map, true } // HasMap returns a boolean if a field has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool { - if o != nil && o.Map != nil { + if o != nil && !isNil(o.Map) { return true } @@ -137,13 +137,13 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Uuid != nil { + if !isNil(o.Uuid) { toSerialize["uuid"] = o.Uuid } - if o.DateTime != nil { + if !isNil(o.DateTime) { toSerialize["dateTime"] = o.DateTime } - if o.Map != nil { + if !isNil(o.Map) { toSerialize["map"] = o.Map } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_name.go b/samples/client/petstore/go/go-petstore/model_name.go index 46b6b26c0f2..98d098343b1 100644 --- a/samples/client/petstore/go/go-petstore/model_name.go +++ b/samples/client/petstore/go/go-petstore/model_name.go @@ -54,7 +54,7 @@ func (o *Name) GetName() int32 { // and a boolean to check if the value has been set. func (o *Name) GetNameOk() (*int32, bool) { if o == nil { - return nil, false + return nil, false } return &o.Name, true } @@ -66,7 +66,7 @@ func (o *Name) SetName(v int32) { // GetSnakeCase returns the SnakeCase field value if set, zero value otherwise. func (o *Name) GetSnakeCase() int32 { - if o == nil || o.SnakeCase == nil { + if o == nil || isNil(o.SnakeCase) { var ret int32 return ret } @@ -76,15 +76,15 @@ func (o *Name) GetSnakeCase() int32 { // GetSnakeCaseOk returns a tuple with the SnakeCase field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Name) GetSnakeCaseOk() (*int32, bool) { - if o == nil || o.SnakeCase == nil { - return nil, false + if o == nil || isNil(o.SnakeCase) { + return nil, false } return o.SnakeCase, true } // HasSnakeCase returns a boolean if a field has been set. func (o *Name) HasSnakeCase() bool { - if o != nil && o.SnakeCase != nil { + if o != nil && !isNil(o.SnakeCase) { return true } @@ -98,7 +98,7 @@ func (o *Name) SetSnakeCase(v int32) { // GetProperty returns the Property field value if set, zero value otherwise. func (o *Name) GetProperty() string { - if o == nil || o.Property == nil { + if o == nil || isNil(o.Property) { var ret string return ret } @@ -108,15 +108,15 @@ func (o *Name) GetProperty() string { // GetPropertyOk returns a tuple with the Property field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Name) GetPropertyOk() (*string, bool) { - if o == nil || o.Property == nil { - return nil, false + if o == nil || isNil(o.Property) { + return nil, false } return o.Property, true } // HasProperty returns a boolean if a field has been set. func (o *Name) HasProperty() bool { - if o != nil && o.Property != nil { + if o != nil && !isNil(o.Property) { return true } @@ -130,7 +130,7 @@ func (o *Name) SetProperty(v string) { // GetVar123Number returns the Var123Number field value if set, zero value otherwise. func (o *Name) GetVar123Number() int32 { - if o == nil || o.Var123Number == nil { + if o == nil || isNil(o.Var123Number) { var ret int32 return ret } @@ -140,15 +140,15 @@ func (o *Name) GetVar123Number() int32 { // GetVar123NumberOk returns a tuple with the Var123Number field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Name) GetVar123NumberOk() (*int32, bool) { - if o == nil || o.Var123Number == nil { - return nil, false + if o == nil || isNil(o.Var123Number) { + return nil, false } return o.Var123Number, true } // HasVar123Number returns a boolean if a field has been set. func (o *Name) HasVar123Number() bool { - if o != nil && o.Var123Number != nil { + if o != nil && !isNil(o.Var123Number) { return true } @@ -165,13 +165,13 @@ func (o Name) MarshalJSON() ([]byte, error) { if true { toSerialize["name"] = o.Name } - if o.SnakeCase != nil { + if !isNil(o.SnakeCase) { toSerialize["snake_case"] = o.SnakeCase } - if o.Property != nil { + if !isNil(o.Property) { toSerialize["property"] = o.Property } - if o.Var123Number != nil { + if !isNil(o.Var123Number) { toSerialize["123Number"] = o.Var123Number } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_number_only.go b/samples/client/petstore/go/go-petstore/model_number_only.go index 5635629f38f..d935a91b3bf 100644 --- a/samples/client/petstore/go/go-petstore/model_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_number_only.go @@ -38,7 +38,7 @@ func NewNumberOnlyWithDefaults() *NumberOnly { // GetJustNumber returns the JustNumber field value if set, zero value otherwise. func (o *NumberOnly) GetJustNumber() float32 { - if o == nil || o.JustNumber == nil { + if o == nil || isNil(o.JustNumber) { var ret float32 return ret } @@ -48,15 +48,15 @@ func (o *NumberOnly) GetJustNumber() float32 { // GetJustNumberOk returns a tuple with the JustNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *NumberOnly) GetJustNumberOk() (*float32, bool) { - if o == nil || o.JustNumber == nil { - return nil, false + if o == nil || isNil(o.JustNumber) { + return nil, false } return o.JustNumber, true } // HasJustNumber returns a boolean if a field has been set. func (o *NumberOnly) HasJustNumber() bool { - if o != nil && o.JustNumber != nil { + if o != nil && !isNil(o.JustNumber) { return true } @@ -70,7 +70,7 @@ func (o *NumberOnly) SetJustNumber(v float32) { func (o NumberOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.JustNumber != nil { + if !isNil(o.JustNumber) { toSerialize["JustNumber"] = o.JustNumber } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_order.go b/samples/client/petstore/go/go-petstore/model_order.go index fe097aa01ca..a9afd6693d3 100644 --- a/samples/client/petstore/go/go-petstore/model_order.go +++ b/samples/client/petstore/go/go-petstore/model_order.go @@ -49,7 +49,7 @@ func NewOrderWithDefaults() *Order { // GetId returns the Id field value if set, zero value otherwise. func (o *Order) GetId() int64 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int64 return ret } @@ -59,15 +59,15 @@ func (o *Order) GetId() int64 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *Order) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -81,7 +81,7 @@ func (o *Order) SetId(v int64) { // GetPetId returns the PetId field value if set, zero value otherwise. func (o *Order) GetPetId() int64 { - if o == nil || o.PetId == nil { + if o == nil || isNil(o.PetId) { var ret int64 return ret } @@ -91,15 +91,15 @@ func (o *Order) GetPetId() int64 { // GetPetIdOk returns a tuple with the PetId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetPetIdOk() (*int64, bool) { - if o == nil || o.PetId == nil { - return nil, false + if o == nil || isNil(o.PetId) { + return nil, false } return o.PetId, true } // HasPetId returns a boolean if a field has been set. func (o *Order) HasPetId() bool { - if o != nil && o.PetId != nil { + if o != nil && !isNil(o.PetId) { return true } @@ -113,7 +113,7 @@ func (o *Order) SetPetId(v int64) { // GetQuantity returns the Quantity field value if set, zero value otherwise. func (o *Order) GetQuantity() int32 { - if o == nil || o.Quantity == nil { + if o == nil || isNil(o.Quantity) { var ret int32 return ret } @@ -123,15 +123,15 @@ func (o *Order) GetQuantity() int32 { // GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetQuantityOk() (*int32, bool) { - if o == nil || o.Quantity == nil { - return nil, false + if o == nil || isNil(o.Quantity) { + return nil, false } return o.Quantity, true } // HasQuantity returns a boolean if a field has been set. func (o *Order) HasQuantity() bool { - if o != nil && o.Quantity != nil { + if o != nil && !isNil(o.Quantity) { return true } @@ -145,7 +145,7 @@ func (o *Order) SetQuantity(v int32) { // GetShipDate returns the ShipDate field value if set, zero value otherwise. func (o *Order) GetShipDate() time.Time { - if o == nil || o.ShipDate == nil { + if o == nil || isNil(o.ShipDate) { var ret time.Time return ret } @@ -155,15 +155,15 @@ func (o *Order) GetShipDate() time.Time { // GetShipDateOk returns a tuple with the ShipDate field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetShipDateOk() (*time.Time, bool) { - if o == nil || o.ShipDate == nil { - return nil, false + if o == nil || isNil(o.ShipDate) { + return nil, false } return o.ShipDate, true } // HasShipDate returns a boolean if a field has been set. func (o *Order) HasShipDate() bool { - if o != nil && o.ShipDate != nil { + if o != nil && !isNil(o.ShipDate) { return true } @@ -177,7 +177,7 @@ func (o *Order) SetShipDate(v time.Time) { // GetStatus returns the Status field value if set, zero value otherwise. func (o *Order) GetStatus() string { - if o == nil || o.Status == nil { + if o == nil || isNil(o.Status) { var ret string return ret } @@ -187,15 +187,15 @@ func (o *Order) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false + if o == nil || isNil(o.Status) { + return nil, false } return o.Status, true } // HasStatus returns a boolean if a field has been set. func (o *Order) HasStatus() bool { - if o != nil && o.Status != nil { + if o != nil && !isNil(o.Status) { return true } @@ -209,7 +209,7 @@ func (o *Order) SetStatus(v string) { // GetComplete returns the Complete field value if set, zero value otherwise. func (o *Order) GetComplete() bool { - if o == nil || o.Complete == nil { + if o == nil || isNil(o.Complete) { var ret bool return ret } @@ -219,15 +219,15 @@ func (o *Order) GetComplete() bool { // GetCompleteOk returns a tuple with the Complete field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetCompleteOk() (*bool, bool) { - if o == nil || o.Complete == nil { - return nil, false + if o == nil || isNil(o.Complete) { + return nil, false } return o.Complete, true } // HasComplete returns a boolean if a field has been set. func (o *Order) HasComplete() bool { - if o != nil && o.Complete != nil { + if o != nil && !isNil(o.Complete) { return true } @@ -241,22 +241,22 @@ func (o *Order) SetComplete(v bool) { func (o Order) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !isNil(o.Id) { toSerialize["id"] = o.Id } - if o.PetId != nil { + if !isNil(o.PetId) { toSerialize["petId"] = o.PetId } - if o.Quantity != nil { + if !isNil(o.Quantity) { toSerialize["quantity"] = o.Quantity } - if o.ShipDate != nil { + if !isNil(o.ShipDate) { toSerialize["shipDate"] = o.ShipDate } - if o.Status != nil { + if !isNil(o.Status) { toSerialize["status"] = o.Status } - if o.Complete != nil { + if !isNil(o.Complete) { toSerialize["complete"] = o.Complete } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_outer_composite.go b/samples/client/petstore/go/go-petstore/model_outer_composite.go index 77a0e226f70..8d5bb096b30 100644 --- a/samples/client/petstore/go/go-petstore/model_outer_composite.go +++ b/samples/client/petstore/go/go-petstore/model_outer_composite.go @@ -40,7 +40,7 @@ func NewOuterCompositeWithDefaults() *OuterComposite { // GetMyNumber returns the MyNumber field value if set, zero value otherwise. func (o *OuterComposite) GetMyNumber() float32 { - if o == nil || o.MyNumber == nil { + if o == nil || isNil(o.MyNumber) { var ret float32 return ret } @@ -50,15 +50,15 @@ func (o *OuterComposite) GetMyNumber() float32 { // GetMyNumberOk returns a tuple with the MyNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OuterComposite) GetMyNumberOk() (*float32, bool) { - if o == nil || o.MyNumber == nil { - return nil, false + if o == nil || isNil(o.MyNumber) { + return nil, false } return o.MyNumber, true } // HasMyNumber returns a boolean if a field has been set. func (o *OuterComposite) HasMyNumber() bool { - if o != nil && o.MyNumber != nil { + if o != nil && !isNil(o.MyNumber) { return true } @@ -72,7 +72,7 @@ func (o *OuterComposite) SetMyNumber(v float32) { // GetMyString returns the MyString field value if set, zero value otherwise. func (o *OuterComposite) GetMyString() string { - if o == nil || o.MyString == nil { + if o == nil || isNil(o.MyString) { var ret string return ret } @@ -82,15 +82,15 @@ func (o *OuterComposite) GetMyString() string { // GetMyStringOk returns a tuple with the MyString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OuterComposite) GetMyStringOk() (*string, bool) { - if o == nil || o.MyString == nil { - return nil, false + if o == nil || isNil(o.MyString) { + return nil, false } return o.MyString, true } // HasMyString returns a boolean if a field has been set. func (o *OuterComposite) HasMyString() bool { - if o != nil && o.MyString != nil { + if o != nil && !isNil(o.MyString) { return true } @@ -104,7 +104,7 @@ func (o *OuterComposite) SetMyString(v string) { // GetMyBoolean returns the MyBoolean field value if set, zero value otherwise. func (o *OuterComposite) GetMyBoolean() bool { - if o == nil || o.MyBoolean == nil { + if o == nil || isNil(o.MyBoolean) { var ret bool return ret } @@ -114,15 +114,15 @@ func (o *OuterComposite) GetMyBoolean() bool { // GetMyBooleanOk returns a tuple with the MyBoolean field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OuterComposite) GetMyBooleanOk() (*bool, bool) { - if o == nil || o.MyBoolean == nil { - return nil, false + if o == nil || isNil(o.MyBoolean) { + return nil, false } return o.MyBoolean, true } // HasMyBoolean returns a boolean if a field has been set. func (o *OuterComposite) HasMyBoolean() bool { - if o != nil && o.MyBoolean != nil { + if o != nil && !isNil(o.MyBoolean) { return true } @@ -136,13 +136,13 @@ func (o *OuterComposite) SetMyBoolean(v bool) { func (o OuterComposite) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MyNumber != nil { + if !isNil(o.MyNumber) { toSerialize["my_number"] = o.MyNumber } - if o.MyString != nil { + if !isNil(o.MyString) { toSerialize["my_string"] = o.MyString } - if o.MyBoolean != nil { + if !isNil(o.MyBoolean) { toSerialize["my_boolean"] = o.MyBoolean } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_pet.go b/samples/client/petstore/go/go-petstore/model_pet.go index 8d7710e7622..f53374c5236 100644 --- a/samples/client/petstore/go/go-petstore/model_pet.go +++ b/samples/client/petstore/go/go-petstore/model_pet.go @@ -46,7 +46,7 @@ func NewPetWithDefaults() *Pet { // GetId returns the Id field value if set, zero value otherwise. func (o *Pet) GetId() int64 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int64 return ret } @@ -56,15 +56,15 @@ func (o *Pet) GetId() int64 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pet) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *Pet) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -78,7 +78,7 @@ func (o *Pet) SetId(v int64) { // GetCategory returns the Category field value if set, zero value otherwise. func (o *Pet) GetCategory() Category { - if o == nil || o.Category == nil { + if o == nil || isNil(o.Category) { var ret Category return ret } @@ -88,15 +88,15 @@ func (o *Pet) GetCategory() Category { // GetCategoryOk returns a tuple with the Category field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pet) GetCategoryOk() (*Category, bool) { - if o == nil || o.Category == nil { - return nil, false + if o == nil || isNil(o.Category) { + return nil, false } return o.Category, true } // HasCategory returns a boolean if a field has been set. func (o *Pet) HasCategory() bool { - if o != nil && o.Category != nil { + if o != nil && !isNil(o.Category) { return true } @@ -122,7 +122,7 @@ func (o *Pet) GetName() string { // and a boolean to check if the value has been set. func (o *Pet) GetNameOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Name, true } @@ -146,7 +146,7 @@ func (o *Pet) GetPhotoUrls() []string { // and a boolean to check if the value has been set. func (o *Pet) GetPhotoUrlsOk() ([]string, bool) { if o == nil { - return nil, false + return nil, false } return o.PhotoUrls, true } @@ -158,7 +158,7 @@ func (o *Pet) SetPhotoUrls(v []string) { // GetTags returns the Tags field value if set, zero value otherwise. func (o *Pet) GetTags() []Tag { - if o == nil || o.Tags == nil { + if o == nil || isNil(o.Tags) { var ret []Tag return ret } @@ -168,15 +168,15 @@ func (o *Pet) GetTags() []Tag { // GetTagsOk returns a tuple with the Tags field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pet) GetTagsOk() ([]Tag, bool) { - if o == nil || o.Tags == nil { - return nil, false + if o == nil || isNil(o.Tags) { + return nil, false } return o.Tags, true } // HasTags returns a boolean if a field has been set. func (o *Pet) HasTags() bool { - if o != nil && o.Tags != nil { + if o != nil && !isNil(o.Tags) { return true } @@ -190,7 +190,7 @@ func (o *Pet) SetTags(v []Tag) { // GetStatus returns the Status field value if set, zero value otherwise. func (o *Pet) GetStatus() string { - if o == nil || o.Status == nil { + if o == nil || isNil(o.Status) { var ret string return ret } @@ -200,15 +200,15 @@ func (o *Pet) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pet) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false + if o == nil || isNil(o.Status) { + return nil, false } return o.Status, true } // HasStatus returns a boolean if a field has been set. func (o *Pet) HasStatus() bool { - if o != nil && o.Status != nil { + if o != nil && !isNil(o.Status) { return true } @@ -222,10 +222,10 @@ func (o *Pet) SetStatus(v string) { func (o Pet) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !isNil(o.Id) { toSerialize["id"] = o.Id } - if o.Category != nil { + if !isNil(o.Category) { toSerialize["category"] = o.Category } if true { @@ -234,10 +234,10 @@ func (o Pet) MarshalJSON() ([]byte, error) { if true { toSerialize["photoUrls"] = o.PhotoUrls } - if o.Tags != nil { + if !isNil(o.Tags) { toSerialize["tags"] = o.Tags } - if o.Status != nil { + if !isNil(o.Status) { toSerialize["status"] = o.Status } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_read_only_first.go b/samples/client/petstore/go/go-petstore/model_read_only_first.go index 23766a7a46b..5d051234960 100644 --- a/samples/client/petstore/go/go-petstore/model_read_only_first.go +++ b/samples/client/petstore/go/go-petstore/model_read_only_first.go @@ -39,7 +39,7 @@ func NewReadOnlyFirstWithDefaults() *ReadOnlyFirst { // GetBar returns the Bar field value if set, zero value otherwise. func (o *ReadOnlyFirst) GetBar() string { - if o == nil || o.Bar == nil { + if o == nil || isNil(o.Bar) { var ret string return ret } @@ -49,15 +49,15 @@ func (o *ReadOnlyFirst) GetBar() string { // GetBarOk returns a tuple with the Bar field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyFirst) GetBarOk() (*string, bool) { - if o == nil || o.Bar == nil { - return nil, false + if o == nil || isNil(o.Bar) { + return nil, false } return o.Bar, true } // HasBar returns a boolean if a field has been set. func (o *ReadOnlyFirst) HasBar() bool { - if o != nil && o.Bar != nil { + if o != nil && !isNil(o.Bar) { return true } @@ -71,7 +71,7 @@ func (o *ReadOnlyFirst) SetBar(v string) { // GetBaz returns the Baz field value if set, zero value otherwise. func (o *ReadOnlyFirst) GetBaz() string { - if o == nil || o.Baz == nil { + if o == nil || isNil(o.Baz) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *ReadOnlyFirst) GetBaz() string { // GetBazOk returns a tuple with the Baz field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyFirst) GetBazOk() (*string, bool) { - if o == nil || o.Baz == nil { - return nil, false + if o == nil || isNil(o.Baz) { + return nil, false } return o.Baz, true } // HasBaz returns a boolean if a field has been set. func (o *ReadOnlyFirst) HasBaz() bool { - if o != nil && o.Baz != nil { + if o != nil && !isNil(o.Baz) { return true } @@ -103,10 +103,10 @@ func (o *ReadOnlyFirst) SetBaz(v string) { func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Bar != nil { + if !isNil(o.Bar) { toSerialize["bar"] = o.Bar } - if o.Baz != nil { + if !isNil(o.Baz) { toSerialize["baz"] = o.Baz } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_return.go b/samples/client/petstore/go/go-petstore/model_return.go index 3949d2e26bd..62fcb20af41 100644 --- a/samples/client/petstore/go/go-petstore/model_return.go +++ b/samples/client/petstore/go/go-petstore/model_return.go @@ -38,7 +38,7 @@ func NewReturnWithDefaults() *Return { // GetReturn returns the Return field value if set, zero value otherwise. func (o *Return) GetReturn() int32 { - if o == nil || o.Return == nil { + if o == nil || isNil(o.Return) { var ret int32 return ret } @@ -48,15 +48,15 @@ func (o *Return) GetReturn() int32 { // GetReturnOk returns a tuple with the Return field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Return) GetReturnOk() (*int32, bool) { - if o == nil || o.Return == nil { - return nil, false + if o == nil || isNil(o.Return) { + return nil, false } return o.Return, true } // HasReturn returns a boolean if a field has been set. func (o *Return) HasReturn() bool { - if o != nil && o.Return != nil { + if o != nil && !isNil(o.Return) { return true } @@ -70,7 +70,7 @@ func (o *Return) SetReturn(v int32) { func (o Return) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Return != nil { + if !isNil(o.Return) { toSerialize["return"] = o.Return } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_special_model_name.go b/samples/client/petstore/go/go-petstore/model_special_model_name.go index 7f0535ee23c..ba232f8d8f3 100644 --- a/samples/client/petstore/go/go-petstore/model_special_model_name.go +++ b/samples/client/petstore/go/go-petstore/model_special_model_name.go @@ -38,7 +38,7 @@ func NewSpecialModelNameWithDefaults() *SpecialModelName { // GetSpecialPropertyName returns the SpecialPropertyName field value if set, zero value otherwise. func (o *SpecialModelName) GetSpecialPropertyName() int64 { - if o == nil || o.SpecialPropertyName == nil { + if o == nil || isNil(o.SpecialPropertyName) { var ret int64 return ret } @@ -48,15 +48,15 @@ func (o *SpecialModelName) GetSpecialPropertyName() int64 { // GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SpecialModelName) GetSpecialPropertyNameOk() (*int64, bool) { - if o == nil || o.SpecialPropertyName == nil { - return nil, false + if o == nil || isNil(o.SpecialPropertyName) { + return nil, false } return o.SpecialPropertyName, true } // HasSpecialPropertyName returns a boolean if a field has been set. func (o *SpecialModelName) HasSpecialPropertyName() bool { - if o != nil && o.SpecialPropertyName != nil { + if o != nil && !isNil(o.SpecialPropertyName) { return true } @@ -70,7 +70,7 @@ func (o *SpecialModelName) SetSpecialPropertyName(v int64) { func (o SpecialModelName) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SpecialPropertyName != nil { + if !isNil(o.SpecialPropertyName) { toSerialize["$special[property.name]"] = o.SpecialPropertyName } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_tag.go b/samples/client/petstore/go/go-petstore/model_tag.go index ae0ed723b7c..aa5518326ae 100644 --- a/samples/client/petstore/go/go-petstore/model_tag.go +++ b/samples/client/petstore/go/go-petstore/model_tag.go @@ -39,7 +39,7 @@ func NewTagWithDefaults() *Tag { // GetId returns the Id field value if set, zero value otherwise. func (o *Tag) GetId() int64 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int64 return ret } @@ -49,15 +49,15 @@ func (o *Tag) GetId() int64 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Tag) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *Tag) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -71,7 +71,7 @@ func (o *Tag) SetId(v int64) { // GetName returns the Name field value if set, zero value otherwise. func (o *Tag) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *Tag) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Tag) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *Tag) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -103,10 +103,10 @@ func (o *Tag) SetName(v string) { func (o Tag) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !isNil(o.Id) { toSerialize["id"] = o.Id } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_default.go b/samples/client/petstore/go/go-petstore/model_type_holder_default.go index ab921b3f1e5..4d5b3f612b6 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_default.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_default.go @@ -63,7 +63,7 @@ func (o *TypeHolderDefault) GetStringItem() string { // and a boolean to check if the value has been set. func (o *TypeHolderDefault) GetStringItemOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.StringItem, true } @@ -87,7 +87,7 @@ func (o *TypeHolderDefault) GetNumberItem() float32 { // and a boolean to check if the value has been set. func (o *TypeHolderDefault) GetNumberItemOk() (*float32, bool) { if o == nil { - return nil, false + return nil, false } return &o.NumberItem, true } @@ -111,7 +111,7 @@ func (o *TypeHolderDefault) GetIntegerItem() int32 { // and a boolean to check if the value has been set. func (o *TypeHolderDefault) GetIntegerItemOk() (*int32, bool) { if o == nil { - return nil, false + return nil, false } return &o.IntegerItem, true } @@ -135,7 +135,7 @@ func (o *TypeHolderDefault) GetBoolItem() bool { // and a boolean to check if the value has been set. func (o *TypeHolderDefault) GetBoolItemOk() (*bool, bool) { if o == nil { - return nil, false + return nil, false } return &o.BoolItem, true } @@ -159,7 +159,7 @@ func (o *TypeHolderDefault) GetArrayItem() []int32 { // and a boolean to check if the value has been set. func (o *TypeHolderDefault) GetArrayItemOk() ([]int32, bool) { if o == nil { - return nil, false + return nil, false } return o.ArrayItem, true } diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_example.go b/samples/client/petstore/go/go-petstore/model_type_holder_example.go index 9d0979ff148..c166ea0cffd 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_example.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_example.go @@ -61,7 +61,7 @@ func (o *TypeHolderExample) GetStringItem() string { // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetStringItemOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.StringItem, true } @@ -85,7 +85,7 @@ func (o *TypeHolderExample) GetNumberItem() float32 { // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetNumberItemOk() (*float32, bool) { if o == nil { - return nil, false + return nil, false } return &o.NumberItem, true } @@ -109,7 +109,7 @@ func (o *TypeHolderExample) GetFloatItem() float32 { // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetFloatItemOk() (*float32, bool) { if o == nil { - return nil, false + return nil, false } return &o.FloatItem, true } @@ -133,7 +133,7 @@ func (o *TypeHolderExample) GetIntegerItem() int32 { // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetIntegerItemOk() (*int32, bool) { if o == nil { - return nil, false + return nil, false } return &o.IntegerItem, true } @@ -157,7 +157,7 @@ func (o *TypeHolderExample) GetBoolItem() bool { // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetBoolItemOk() (*bool, bool) { if o == nil { - return nil, false + return nil, false } return &o.BoolItem, true } @@ -181,7 +181,7 @@ func (o *TypeHolderExample) GetArrayItem() []int32 { // and a boolean to check if the value has been set. func (o *TypeHolderExample) GetArrayItemOk() ([]int32, bool) { if o == nil { - return nil, false + return nil, false } return o.ArrayItem, true } diff --git a/samples/client/petstore/go/go-petstore/model_user.go b/samples/client/petstore/go/go-petstore/model_user.go index 01ab25a523b..900951571dc 100644 --- a/samples/client/petstore/go/go-petstore/model_user.go +++ b/samples/client/petstore/go/go-petstore/model_user.go @@ -46,7 +46,7 @@ func NewUserWithDefaults() *User { // GetId returns the Id field value if set, zero value otherwise. func (o *User) GetId() int64 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int64 return ret } @@ -56,15 +56,15 @@ func (o *User) GetId() int64 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *User) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -78,7 +78,7 @@ func (o *User) SetId(v int64) { // GetUsername returns the Username field value if set, zero value otherwise. func (o *User) GetUsername() string { - if o == nil || o.Username == nil { + if o == nil || isNil(o.Username) { var ret string return ret } @@ -88,15 +88,15 @@ func (o *User) GetUsername() string { // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetUsernameOk() (*string, bool) { - if o == nil || o.Username == nil { - return nil, false + if o == nil || isNil(o.Username) { + return nil, false } return o.Username, true } // HasUsername returns a boolean if a field has been set. func (o *User) HasUsername() bool { - if o != nil && o.Username != nil { + if o != nil && !isNil(o.Username) { return true } @@ -110,7 +110,7 @@ func (o *User) SetUsername(v string) { // GetFirstName returns the FirstName field value if set, zero value otherwise. func (o *User) GetFirstName() string { - if o == nil || o.FirstName == nil { + if o == nil || isNil(o.FirstName) { var ret string return ret } @@ -120,15 +120,15 @@ func (o *User) GetFirstName() string { // GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetFirstNameOk() (*string, bool) { - if o == nil || o.FirstName == nil { - return nil, false + if o == nil || isNil(o.FirstName) { + return nil, false } return o.FirstName, true } // HasFirstName returns a boolean if a field has been set. func (o *User) HasFirstName() bool { - if o != nil && o.FirstName != nil { + if o != nil && !isNil(o.FirstName) { return true } @@ -142,7 +142,7 @@ func (o *User) SetFirstName(v string) { // GetLastName returns the LastName field value if set, zero value otherwise. func (o *User) GetLastName() string { - if o == nil || o.LastName == nil { + if o == nil || isNil(o.LastName) { var ret string return ret } @@ -152,15 +152,15 @@ func (o *User) GetLastName() string { // GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetLastNameOk() (*string, bool) { - if o == nil || o.LastName == nil { - return nil, false + if o == nil || isNil(o.LastName) { + return nil, false } return o.LastName, true } // HasLastName returns a boolean if a field has been set. func (o *User) HasLastName() bool { - if o != nil && o.LastName != nil { + if o != nil && !isNil(o.LastName) { return true } @@ -174,7 +174,7 @@ func (o *User) SetLastName(v string) { // GetEmail returns the Email field value if set, zero value otherwise. func (o *User) GetEmail() string { - if o == nil || o.Email == nil { + if o == nil || isNil(o.Email) { var ret string return ret } @@ -184,15 +184,15 @@ func (o *User) GetEmail() string { // GetEmailOk returns a tuple with the Email field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetEmailOk() (*string, bool) { - if o == nil || o.Email == nil { - return nil, false + if o == nil || isNil(o.Email) { + return nil, false } return o.Email, true } // HasEmail returns a boolean if a field has been set. func (o *User) HasEmail() bool { - if o != nil && o.Email != nil { + if o != nil && !isNil(o.Email) { return true } @@ -206,7 +206,7 @@ func (o *User) SetEmail(v string) { // GetPassword returns the Password field value if set, zero value otherwise. func (o *User) GetPassword() string { - if o == nil || o.Password == nil { + if o == nil || isNil(o.Password) { var ret string return ret } @@ -216,15 +216,15 @@ func (o *User) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false + if o == nil || isNil(o.Password) { + return nil, false } return o.Password, true } // HasPassword returns a boolean if a field has been set. func (o *User) HasPassword() bool { - if o != nil && o.Password != nil { + if o != nil && !isNil(o.Password) { return true } @@ -238,7 +238,7 @@ func (o *User) SetPassword(v string) { // GetPhone returns the Phone field value if set, zero value otherwise. func (o *User) GetPhone() string { - if o == nil || o.Phone == nil { + if o == nil || isNil(o.Phone) { var ret string return ret } @@ -248,15 +248,15 @@ func (o *User) GetPhone() string { // GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetPhoneOk() (*string, bool) { - if o == nil || o.Phone == nil { - return nil, false + if o == nil || isNil(o.Phone) { + return nil, false } return o.Phone, true } // HasPhone returns a boolean if a field has been set. func (o *User) HasPhone() bool { - if o != nil && o.Phone != nil { + if o != nil && !isNil(o.Phone) { return true } @@ -270,7 +270,7 @@ func (o *User) SetPhone(v string) { // GetUserStatus returns the UserStatus field value if set, zero value otherwise. func (o *User) GetUserStatus() int32 { - if o == nil || o.UserStatus == nil { + if o == nil || isNil(o.UserStatus) { var ret int32 return ret } @@ -280,15 +280,15 @@ func (o *User) GetUserStatus() int32 { // GetUserStatusOk returns a tuple with the UserStatus field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetUserStatusOk() (*int32, bool) { - if o == nil || o.UserStatus == nil { - return nil, false + if o == nil || isNil(o.UserStatus) { + return nil, false } return o.UserStatus, true } // HasUserStatus returns a boolean if a field has been set. func (o *User) HasUserStatus() bool { - if o != nil && o.UserStatus != nil { + if o != nil && !isNil(o.UserStatus) { return true } @@ -302,28 +302,28 @@ func (o *User) SetUserStatus(v int32) { func (o User) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !isNil(o.Id) { toSerialize["id"] = o.Id } - if o.Username != nil { + if !isNil(o.Username) { toSerialize["username"] = o.Username } - if o.FirstName != nil { + if !isNil(o.FirstName) { toSerialize["firstName"] = o.FirstName } - if o.LastName != nil { + if !isNil(o.LastName) { toSerialize["lastName"] = o.LastName } - if o.Email != nil { + if !isNil(o.Email) { toSerialize["email"] = o.Email } - if o.Password != nil { + if !isNil(o.Password) { toSerialize["password"] = o.Password } - if o.Phone != nil { + if !isNil(o.Phone) { toSerialize["phone"] = o.Phone } - if o.UserStatus != nil { + if !isNil(o.UserStatus) { toSerialize["userStatus"] = o.UserStatus } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/model_xml_item.go b/samples/client/petstore/go/go-petstore/model_xml_item.go index 31a23e27309..c22bb15a399 100644 --- a/samples/client/petstore/go/go-petstore/model_xml_item.go +++ b/samples/client/petstore/go/go-petstore/model_xml_item.go @@ -66,7 +66,7 @@ func NewXmlItemWithDefaults() *XmlItem { // GetAttributeString returns the AttributeString field value if set, zero value otherwise. func (o *XmlItem) GetAttributeString() string { - if o == nil || o.AttributeString == nil { + if o == nil || isNil(o.AttributeString) { var ret string return ret } @@ -76,15 +76,15 @@ func (o *XmlItem) GetAttributeString() string { // GetAttributeStringOk returns a tuple with the AttributeString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetAttributeStringOk() (*string, bool) { - if o == nil || o.AttributeString == nil { - return nil, false + if o == nil || isNil(o.AttributeString) { + return nil, false } return o.AttributeString, true } // HasAttributeString returns a boolean if a field has been set. func (o *XmlItem) HasAttributeString() bool { - if o != nil && o.AttributeString != nil { + if o != nil && !isNil(o.AttributeString) { return true } @@ -98,7 +98,7 @@ func (o *XmlItem) SetAttributeString(v string) { // GetAttributeNumber returns the AttributeNumber field value if set, zero value otherwise. func (o *XmlItem) GetAttributeNumber() float32 { - if o == nil || o.AttributeNumber == nil { + if o == nil || isNil(o.AttributeNumber) { var ret float32 return ret } @@ -108,15 +108,15 @@ func (o *XmlItem) GetAttributeNumber() float32 { // GetAttributeNumberOk returns a tuple with the AttributeNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetAttributeNumberOk() (*float32, bool) { - if o == nil || o.AttributeNumber == nil { - return nil, false + if o == nil || isNil(o.AttributeNumber) { + return nil, false } return o.AttributeNumber, true } // HasAttributeNumber returns a boolean if a field has been set. func (o *XmlItem) HasAttributeNumber() bool { - if o != nil && o.AttributeNumber != nil { + if o != nil && !isNil(o.AttributeNumber) { return true } @@ -130,7 +130,7 @@ func (o *XmlItem) SetAttributeNumber(v float32) { // GetAttributeInteger returns the AttributeInteger field value if set, zero value otherwise. func (o *XmlItem) GetAttributeInteger() int32 { - if o == nil || o.AttributeInteger == nil { + if o == nil || isNil(o.AttributeInteger) { var ret int32 return ret } @@ -140,15 +140,15 @@ func (o *XmlItem) GetAttributeInteger() int32 { // GetAttributeIntegerOk returns a tuple with the AttributeInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetAttributeIntegerOk() (*int32, bool) { - if o == nil || o.AttributeInteger == nil { - return nil, false + if o == nil || isNil(o.AttributeInteger) { + return nil, false } return o.AttributeInteger, true } // HasAttributeInteger returns a boolean if a field has been set. func (o *XmlItem) HasAttributeInteger() bool { - if o != nil && o.AttributeInteger != nil { + if o != nil && !isNil(o.AttributeInteger) { return true } @@ -162,7 +162,7 @@ func (o *XmlItem) SetAttributeInteger(v int32) { // GetAttributeBoolean returns the AttributeBoolean field value if set, zero value otherwise. func (o *XmlItem) GetAttributeBoolean() bool { - if o == nil || o.AttributeBoolean == nil { + if o == nil || isNil(o.AttributeBoolean) { var ret bool return ret } @@ -172,15 +172,15 @@ func (o *XmlItem) GetAttributeBoolean() bool { // GetAttributeBooleanOk returns a tuple with the AttributeBoolean field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetAttributeBooleanOk() (*bool, bool) { - if o == nil || o.AttributeBoolean == nil { - return nil, false + if o == nil || isNil(o.AttributeBoolean) { + return nil, false } return o.AttributeBoolean, true } // HasAttributeBoolean returns a boolean if a field has been set. func (o *XmlItem) HasAttributeBoolean() bool { - if o != nil && o.AttributeBoolean != nil { + if o != nil && !isNil(o.AttributeBoolean) { return true } @@ -194,7 +194,7 @@ func (o *XmlItem) SetAttributeBoolean(v bool) { // GetWrappedArray returns the WrappedArray field value if set, zero value otherwise. func (o *XmlItem) GetWrappedArray() []int32 { - if o == nil || o.WrappedArray == nil { + if o == nil || isNil(o.WrappedArray) { var ret []int32 return ret } @@ -204,15 +204,15 @@ func (o *XmlItem) GetWrappedArray() []int32 { // GetWrappedArrayOk returns a tuple with the WrappedArray field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetWrappedArrayOk() ([]int32, bool) { - if o == nil || o.WrappedArray == nil { - return nil, false + if o == nil || isNil(o.WrappedArray) { + return nil, false } return o.WrappedArray, true } // HasWrappedArray returns a boolean if a field has been set. func (o *XmlItem) HasWrappedArray() bool { - if o != nil && o.WrappedArray != nil { + if o != nil && !isNil(o.WrappedArray) { return true } @@ -226,7 +226,7 @@ func (o *XmlItem) SetWrappedArray(v []int32) { // GetNameString returns the NameString field value if set, zero value otherwise. func (o *XmlItem) GetNameString() string { - if o == nil || o.NameString == nil { + if o == nil || isNil(o.NameString) { var ret string return ret } @@ -236,15 +236,15 @@ func (o *XmlItem) GetNameString() string { // GetNameStringOk returns a tuple with the NameString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNameStringOk() (*string, bool) { - if o == nil || o.NameString == nil { - return nil, false + if o == nil || isNil(o.NameString) { + return nil, false } return o.NameString, true } // HasNameString returns a boolean if a field has been set. func (o *XmlItem) HasNameString() bool { - if o != nil && o.NameString != nil { + if o != nil && !isNil(o.NameString) { return true } @@ -258,7 +258,7 @@ func (o *XmlItem) SetNameString(v string) { // GetNameNumber returns the NameNumber field value if set, zero value otherwise. func (o *XmlItem) GetNameNumber() float32 { - if o == nil || o.NameNumber == nil { + if o == nil || isNil(o.NameNumber) { var ret float32 return ret } @@ -268,15 +268,15 @@ func (o *XmlItem) GetNameNumber() float32 { // GetNameNumberOk returns a tuple with the NameNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNameNumberOk() (*float32, bool) { - if o == nil || o.NameNumber == nil { - return nil, false + if o == nil || isNil(o.NameNumber) { + return nil, false } return o.NameNumber, true } // HasNameNumber returns a boolean if a field has been set. func (o *XmlItem) HasNameNumber() bool { - if o != nil && o.NameNumber != nil { + if o != nil && !isNil(o.NameNumber) { return true } @@ -290,7 +290,7 @@ func (o *XmlItem) SetNameNumber(v float32) { // GetNameInteger returns the NameInteger field value if set, zero value otherwise. func (o *XmlItem) GetNameInteger() int32 { - if o == nil || o.NameInteger == nil { + if o == nil || isNil(o.NameInteger) { var ret int32 return ret } @@ -300,15 +300,15 @@ func (o *XmlItem) GetNameInteger() int32 { // GetNameIntegerOk returns a tuple with the NameInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNameIntegerOk() (*int32, bool) { - if o == nil || o.NameInteger == nil { - return nil, false + if o == nil || isNil(o.NameInteger) { + return nil, false } return o.NameInteger, true } // HasNameInteger returns a boolean if a field has been set. func (o *XmlItem) HasNameInteger() bool { - if o != nil && o.NameInteger != nil { + if o != nil && !isNil(o.NameInteger) { return true } @@ -322,7 +322,7 @@ func (o *XmlItem) SetNameInteger(v int32) { // GetNameBoolean returns the NameBoolean field value if set, zero value otherwise. func (o *XmlItem) GetNameBoolean() bool { - if o == nil || o.NameBoolean == nil { + if o == nil || isNil(o.NameBoolean) { var ret bool return ret } @@ -332,15 +332,15 @@ func (o *XmlItem) GetNameBoolean() bool { // GetNameBooleanOk returns a tuple with the NameBoolean field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNameBooleanOk() (*bool, bool) { - if o == nil || o.NameBoolean == nil { - return nil, false + if o == nil || isNil(o.NameBoolean) { + return nil, false } return o.NameBoolean, true } // HasNameBoolean returns a boolean if a field has been set. func (o *XmlItem) HasNameBoolean() bool { - if o != nil && o.NameBoolean != nil { + if o != nil && !isNil(o.NameBoolean) { return true } @@ -354,7 +354,7 @@ func (o *XmlItem) SetNameBoolean(v bool) { // GetNameArray returns the NameArray field value if set, zero value otherwise. func (o *XmlItem) GetNameArray() []int32 { - if o == nil || o.NameArray == nil { + if o == nil || isNil(o.NameArray) { var ret []int32 return ret } @@ -364,15 +364,15 @@ func (o *XmlItem) GetNameArray() []int32 { // GetNameArrayOk returns a tuple with the NameArray field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNameArrayOk() ([]int32, bool) { - if o == nil || o.NameArray == nil { - return nil, false + if o == nil || isNil(o.NameArray) { + return nil, false } return o.NameArray, true } // HasNameArray returns a boolean if a field has been set. func (o *XmlItem) HasNameArray() bool { - if o != nil && o.NameArray != nil { + if o != nil && !isNil(o.NameArray) { return true } @@ -386,7 +386,7 @@ func (o *XmlItem) SetNameArray(v []int32) { // GetNameWrappedArray returns the NameWrappedArray field value if set, zero value otherwise. func (o *XmlItem) GetNameWrappedArray() []int32 { - if o == nil || o.NameWrappedArray == nil { + if o == nil || isNil(o.NameWrappedArray) { var ret []int32 return ret } @@ -396,15 +396,15 @@ func (o *XmlItem) GetNameWrappedArray() []int32 { // GetNameWrappedArrayOk returns a tuple with the NameWrappedArray field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNameWrappedArrayOk() ([]int32, bool) { - if o == nil || o.NameWrappedArray == nil { - return nil, false + if o == nil || isNil(o.NameWrappedArray) { + return nil, false } return o.NameWrappedArray, true } // HasNameWrappedArray returns a boolean if a field has been set. func (o *XmlItem) HasNameWrappedArray() bool { - if o != nil && o.NameWrappedArray != nil { + if o != nil && !isNil(o.NameWrappedArray) { return true } @@ -418,7 +418,7 @@ func (o *XmlItem) SetNameWrappedArray(v []int32) { // GetPrefixString returns the PrefixString field value if set, zero value otherwise. func (o *XmlItem) GetPrefixString() string { - if o == nil || o.PrefixString == nil { + if o == nil || isNil(o.PrefixString) { var ret string return ret } @@ -428,15 +428,15 @@ func (o *XmlItem) GetPrefixString() string { // GetPrefixStringOk returns a tuple with the PrefixString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixStringOk() (*string, bool) { - if o == nil || o.PrefixString == nil { - return nil, false + if o == nil || isNil(o.PrefixString) { + return nil, false } return o.PrefixString, true } // HasPrefixString returns a boolean if a field has been set. func (o *XmlItem) HasPrefixString() bool { - if o != nil && o.PrefixString != nil { + if o != nil && !isNil(o.PrefixString) { return true } @@ -450,7 +450,7 @@ func (o *XmlItem) SetPrefixString(v string) { // GetPrefixNumber returns the PrefixNumber field value if set, zero value otherwise. func (o *XmlItem) GetPrefixNumber() float32 { - if o == nil || o.PrefixNumber == nil { + if o == nil || isNil(o.PrefixNumber) { var ret float32 return ret } @@ -460,15 +460,15 @@ func (o *XmlItem) GetPrefixNumber() float32 { // GetPrefixNumberOk returns a tuple with the PrefixNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixNumberOk() (*float32, bool) { - if o == nil || o.PrefixNumber == nil { - return nil, false + if o == nil || isNil(o.PrefixNumber) { + return nil, false } return o.PrefixNumber, true } // HasPrefixNumber returns a boolean if a field has been set. func (o *XmlItem) HasPrefixNumber() bool { - if o != nil && o.PrefixNumber != nil { + if o != nil && !isNil(o.PrefixNumber) { return true } @@ -482,7 +482,7 @@ func (o *XmlItem) SetPrefixNumber(v float32) { // GetPrefixInteger returns the PrefixInteger field value if set, zero value otherwise. func (o *XmlItem) GetPrefixInteger() int32 { - if o == nil || o.PrefixInteger == nil { + if o == nil || isNil(o.PrefixInteger) { var ret int32 return ret } @@ -492,15 +492,15 @@ func (o *XmlItem) GetPrefixInteger() int32 { // GetPrefixIntegerOk returns a tuple with the PrefixInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixIntegerOk() (*int32, bool) { - if o == nil || o.PrefixInteger == nil { - return nil, false + if o == nil || isNil(o.PrefixInteger) { + return nil, false } return o.PrefixInteger, true } // HasPrefixInteger returns a boolean if a field has been set. func (o *XmlItem) HasPrefixInteger() bool { - if o != nil && o.PrefixInteger != nil { + if o != nil && !isNil(o.PrefixInteger) { return true } @@ -514,7 +514,7 @@ func (o *XmlItem) SetPrefixInteger(v int32) { // GetPrefixBoolean returns the PrefixBoolean field value if set, zero value otherwise. func (o *XmlItem) GetPrefixBoolean() bool { - if o == nil || o.PrefixBoolean == nil { + if o == nil || isNil(o.PrefixBoolean) { var ret bool return ret } @@ -524,15 +524,15 @@ func (o *XmlItem) GetPrefixBoolean() bool { // GetPrefixBooleanOk returns a tuple with the PrefixBoolean field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixBooleanOk() (*bool, bool) { - if o == nil || o.PrefixBoolean == nil { - return nil, false + if o == nil || isNil(o.PrefixBoolean) { + return nil, false } return o.PrefixBoolean, true } // HasPrefixBoolean returns a boolean if a field has been set. func (o *XmlItem) HasPrefixBoolean() bool { - if o != nil && o.PrefixBoolean != nil { + if o != nil && !isNil(o.PrefixBoolean) { return true } @@ -546,7 +546,7 @@ func (o *XmlItem) SetPrefixBoolean(v bool) { // GetPrefixArray returns the PrefixArray field value if set, zero value otherwise. func (o *XmlItem) GetPrefixArray() []int32 { - if o == nil || o.PrefixArray == nil { + if o == nil || isNil(o.PrefixArray) { var ret []int32 return ret } @@ -556,15 +556,15 @@ func (o *XmlItem) GetPrefixArray() []int32 { // GetPrefixArrayOk returns a tuple with the PrefixArray field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixArrayOk() ([]int32, bool) { - if o == nil || o.PrefixArray == nil { - return nil, false + if o == nil || isNil(o.PrefixArray) { + return nil, false } return o.PrefixArray, true } // HasPrefixArray returns a boolean if a field has been set. func (o *XmlItem) HasPrefixArray() bool { - if o != nil && o.PrefixArray != nil { + if o != nil && !isNil(o.PrefixArray) { return true } @@ -578,7 +578,7 @@ func (o *XmlItem) SetPrefixArray(v []int32) { // GetPrefixWrappedArray returns the PrefixWrappedArray field value if set, zero value otherwise. func (o *XmlItem) GetPrefixWrappedArray() []int32 { - if o == nil || o.PrefixWrappedArray == nil { + if o == nil || isNil(o.PrefixWrappedArray) { var ret []int32 return ret } @@ -588,15 +588,15 @@ func (o *XmlItem) GetPrefixWrappedArray() []int32 { // GetPrefixWrappedArrayOk returns a tuple with the PrefixWrappedArray field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixWrappedArrayOk() ([]int32, bool) { - if o == nil || o.PrefixWrappedArray == nil { - return nil, false + if o == nil || isNil(o.PrefixWrappedArray) { + return nil, false } return o.PrefixWrappedArray, true } // HasPrefixWrappedArray returns a boolean if a field has been set. func (o *XmlItem) HasPrefixWrappedArray() bool { - if o != nil && o.PrefixWrappedArray != nil { + if o != nil && !isNil(o.PrefixWrappedArray) { return true } @@ -610,7 +610,7 @@ func (o *XmlItem) SetPrefixWrappedArray(v []int32) { // GetNamespaceString returns the NamespaceString field value if set, zero value otherwise. func (o *XmlItem) GetNamespaceString() string { - if o == nil || o.NamespaceString == nil { + if o == nil || isNil(o.NamespaceString) { var ret string return ret } @@ -620,15 +620,15 @@ func (o *XmlItem) GetNamespaceString() string { // GetNamespaceStringOk returns a tuple with the NamespaceString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNamespaceStringOk() (*string, bool) { - if o == nil || o.NamespaceString == nil { - return nil, false + if o == nil || isNil(o.NamespaceString) { + return nil, false } return o.NamespaceString, true } // HasNamespaceString returns a boolean if a field has been set. func (o *XmlItem) HasNamespaceString() bool { - if o != nil && o.NamespaceString != nil { + if o != nil && !isNil(o.NamespaceString) { return true } @@ -642,7 +642,7 @@ func (o *XmlItem) SetNamespaceString(v string) { // GetNamespaceNumber returns the NamespaceNumber field value if set, zero value otherwise. func (o *XmlItem) GetNamespaceNumber() float32 { - if o == nil || o.NamespaceNumber == nil { + if o == nil || isNil(o.NamespaceNumber) { var ret float32 return ret } @@ -652,15 +652,15 @@ func (o *XmlItem) GetNamespaceNumber() float32 { // GetNamespaceNumberOk returns a tuple with the NamespaceNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNamespaceNumberOk() (*float32, bool) { - if o == nil || o.NamespaceNumber == nil { - return nil, false + if o == nil || isNil(o.NamespaceNumber) { + return nil, false } return o.NamespaceNumber, true } // HasNamespaceNumber returns a boolean if a field has been set. func (o *XmlItem) HasNamespaceNumber() bool { - if o != nil && o.NamespaceNumber != nil { + if o != nil && !isNil(o.NamespaceNumber) { return true } @@ -674,7 +674,7 @@ func (o *XmlItem) SetNamespaceNumber(v float32) { // GetNamespaceInteger returns the NamespaceInteger field value if set, zero value otherwise. func (o *XmlItem) GetNamespaceInteger() int32 { - if o == nil || o.NamespaceInteger == nil { + if o == nil || isNil(o.NamespaceInteger) { var ret int32 return ret } @@ -684,15 +684,15 @@ func (o *XmlItem) GetNamespaceInteger() int32 { // GetNamespaceIntegerOk returns a tuple with the NamespaceInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNamespaceIntegerOk() (*int32, bool) { - if o == nil || o.NamespaceInteger == nil { - return nil, false + if o == nil || isNil(o.NamespaceInteger) { + return nil, false } return o.NamespaceInteger, true } // HasNamespaceInteger returns a boolean if a field has been set. func (o *XmlItem) HasNamespaceInteger() bool { - if o != nil && o.NamespaceInteger != nil { + if o != nil && !isNil(o.NamespaceInteger) { return true } @@ -706,7 +706,7 @@ func (o *XmlItem) SetNamespaceInteger(v int32) { // GetNamespaceBoolean returns the NamespaceBoolean field value if set, zero value otherwise. func (o *XmlItem) GetNamespaceBoolean() bool { - if o == nil || o.NamespaceBoolean == nil { + if o == nil || isNil(o.NamespaceBoolean) { var ret bool return ret } @@ -716,15 +716,15 @@ func (o *XmlItem) GetNamespaceBoolean() bool { // GetNamespaceBooleanOk returns a tuple with the NamespaceBoolean field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNamespaceBooleanOk() (*bool, bool) { - if o == nil || o.NamespaceBoolean == nil { - return nil, false + if o == nil || isNil(o.NamespaceBoolean) { + return nil, false } return o.NamespaceBoolean, true } // HasNamespaceBoolean returns a boolean if a field has been set. func (o *XmlItem) HasNamespaceBoolean() bool { - if o != nil && o.NamespaceBoolean != nil { + if o != nil && !isNil(o.NamespaceBoolean) { return true } @@ -738,7 +738,7 @@ func (o *XmlItem) SetNamespaceBoolean(v bool) { // GetNamespaceArray returns the NamespaceArray field value if set, zero value otherwise. func (o *XmlItem) GetNamespaceArray() []int32 { - if o == nil || o.NamespaceArray == nil { + if o == nil || isNil(o.NamespaceArray) { var ret []int32 return ret } @@ -748,15 +748,15 @@ func (o *XmlItem) GetNamespaceArray() []int32 { // GetNamespaceArrayOk returns a tuple with the NamespaceArray field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNamespaceArrayOk() ([]int32, bool) { - if o == nil || o.NamespaceArray == nil { - return nil, false + if o == nil || isNil(o.NamespaceArray) { + return nil, false } return o.NamespaceArray, true } // HasNamespaceArray returns a boolean if a field has been set. func (o *XmlItem) HasNamespaceArray() bool { - if o != nil && o.NamespaceArray != nil { + if o != nil && !isNil(o.NamespaceArray) { return true } @@ -770,7 +770,7 @@ func (o *XmlItem) SetNamespaceArray(v []int32) { // GetNamespaceWrappedArray returns the NamespaceWrappedArray field value if set, zero value otherwise. func (o *XmlItem) GetNamespaceWrappedArray() []int32 { - if o == nil || o.NamespaceWrappedArray == nil { + if o == nil || isNil(o.NamespaceWrappedArray) { var ret []int32 return ret } @@ -780,15 +780,15 @@ func (o *XmlItem) GetNamespaceWrappedArray() []int32 { // GetNamespaceWrappedArrayOk returns a tuple with the NamespaceWrappedArray field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetNamespaceWrappedArrayOk() ([]int32, bool) { - if o == nil || o.NamespaceWrappedArray == nil { - return nil, false + if o == nil || isNil(o.NamespaceWrappedArray) { + return nil, false } return o.NamespaceWrappedArray, true } // HasNamespaceWrappedArray returns a boolean if a field has been set. func (o *XmlItem) HasNamespaceWrappedArray() bool { - if o != nil && o.NamespaceWrappedArray != nil { + if o != nil && !isNil(o.NamespaceWrappedArray) { return true } @@ -802,7 +802,7 @@ func (o *XmlItem) SetNamespaceWrappedArray(v []int32) { // GetPrefixNsString returns the PrefixNsString field value if set, zero value otherwise. func (o *XmlItem) GetPrefixNsString() string { - if o == nil || o.PrefixNsString == nil { + if o == nil || isNil(o.PrefixNsString) { var ret string return ret } @@ -812,15 +812,15 @@ func (o *XmlItem) GetPrefixNsString() string { // GetPrefixNsStringOk returns a tuple with the PrefixNsString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixNsStringOk() (*string, bool) { - if o == nil || o.PrefixNsString == nil { - return nil, false + if o == nil || isNil(o.PrefixNsString) { + return nil, false } return o.PrefixNsString, true } // HasPrefixNsString returns a boolean if a field has been set. func (o *XmlItem) HasPrefixNsString() bool { - if o != nil && o.PrefixNsString != nil { + if o != nil && !isNil(o.PrefixNsString) { return true } @@ -834,7 +834,7 @@ func (o *XmlItem) SetPrefixNsString(v string) { // GetPrefixNsNumber returns the PrefixNsNumber field value if set, zero value otherwise. func (o *XmlItem) GetPrefixNsNumber() float32 { - if o == nil || o.PrefixNsNumber == nil { + if o == nil || isNil(o.PrefixNsNumber) { var ret float32 return ret } @@ -844,15 +844,15 @@ func (o *XmlItem) GetPrefixNsNumber() float32 { // GetPrefixNsNumberOk returns a tuple with the PrefixNsNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixNsNumberOk() (*float32, bool) { - if o == nil || o.PrefixNsNumber == nil { - return nil, false + if o == nil || isNil(o.PrefixNsNumber) { + return nil, false } return o.PrefixNsNumber, true } // HasPrefixNsNumber returns a boolean if a field has been set. func (o *XmlItem) HasPrefixNsNumber() bool { - if o != nil && o.PrefixNsNumber != nil { + if o != nil && !isNil(o.PrefixNsNumber) { return true } @@ -866,7 +866,7 @@ func (o *XmlItem) SetPrefixNsNumber(v float32) { // GetPrefixNsInteger returns the PrefixNsInteger field value if set, zero value otherwise. func (o *XmlItem) GetPrefixNsInteger() int32 { - if o == nil || o.PrefixNsInteger == nil { + if o == nil || isNil(o.PrefixNsInteger) { var ret int32 return ret } @@ -876,15 +876,15 @@ func (o *XmlItem) GetPrefixNsInteger() int32 { // GetPrefixNsIntegerOk returns a tuple with the PrefixNsInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixNsIntegerOk() (*int32, bool) { - if o == nil || o.PrefixNsInteger == nil { - return nil, false + if o == nil || isNil(o.PrefixNsInteger) { + return nil, false } return o.PrefixNsInteger, true } // HasPrefixNsInteger returns a boolean if a field has been set. func (o *XmlItem) HasPrefixNsInteger() bool { - if o != nil && o.PrefixNsInteger != nil { + if o != nil && !isNil(o.PrefixNsInteger) { return true } @@ -898,7 +898,7 @@ func (o *XmlItem) SetPrefixNsInteger(v int32) { // GetPrefixNsBoolean returns the PrefixNsBoolean field value if set, zero value otherwise. func (o *XmlItem) GetPrefixNsBoolean() bool { - if o == nil || o.PrefixNsBoolean == nil { + if o == nil || isNil(o.PrefixNsBoolean) { var ret bool return ret } @@ -908,15 +908,15 @@ func (o *XmlItem) GetPrefixNsBoolean() bool { // GetPrefixNsBooleanOk returns a tuple with the PrefixNsBoolean field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixNsBooleanOk() (*bool, bool) { - if o == nil || o.PrefixNsBoolean == nil { - return nil, false + if o == nil || isNil(o.PrefixNsBoolean) { + return nil, false } return o.PrefixNsBoolean, true } // HasPrefixNsBoolean returns a boolean if a field has been set. func (o *XmlItem) HasPrefixNsBoolean() bool { - if o != nil && o.PrefixNsBoolean != nil { + if o != nil && !isNil(o.PrefixNsBoolean) { return true } @@ -930,7 +930,7 @@ func (o *XmlItem) SetPrefixNsBoolean(v bool) { // GetPrefixNsArray returns the PrefixNsArray field value if set, zero value otherwise. func (o *XmlItem) GetPrefixNsArray() []int32 { - if o == nil || o.PrefixNsArray == nil { + if o == nil || isNil(o.PrefixNsArray) { var ret []int32 return ret } @@ -940,15 +940,15 @@ func (o *XmlItem) GetPrefixNsArray() []int32 { // GetPrefixNsArrayOk returns a tuple with the PrefixNsArray field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixNsArrayOk() ([]int32, bool) { - if o == nil || o.PrefixNsArray == nil { - return nil, false + if o == nil || isNil(o.PrefixNsArray) { + return nil, false } return o.PrefixNsArray, true } // HasPrefixNsArray returns a boolean if a field has been set. func (o *XmlItem) HasPrefixNsArray() bool { - if o != nil && o.PrefixNsArray != nil { + if o != nil && !isNil(o.PrefixNsArray) { return true } @@ -962,7 +962,7 @@ func (o *XmlItem) SetPrefixNsArray(v []int32) { // GetPrefixNsWrappedArray returns the PrefixNsWrappedArray field value if set, zero value otherwise. func (o *XmlItem) GetPrefixNsWrappedArray() []int32 { - if o == nil || o.PrefixNsWrappedArray == nil { + if o == nil || isNil(o.PrefixNsWrappedArray) { var ret []int32 return ret } @@ -972,15 +972,15 @@ func (o *XmlItem) GetPrefixNsWrappedArray() []int32 { // GetPrefixNsWrappedArrayOk returns a tuple with the PrefixNsWrappedArray field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XmlItem) GetPrefixNsWrappedArrayOk() ([]int32, bool) { - if o == nil || o.PrefixNsWrappedArray == nil { - return nil, false + if o == nil || isNil(o.PrefixNsWrappedArray) { + return nil, false } return o.PrefixNsWrappedArray, true } // HasPrefixNsWrappedArray returns a boolean if a field has been set. func (o *XmlItem) HasPrefixNsWrappedArray() bool { - if o != nil && o.PrefixNsWrappedArray != nil { + if o != nil && !isNil(o.PrefixNsWrappedArray) { return true } @@ -994,91 +994,91 @@ func (o *XmlItem) SetPrefixNsWrappedArray(v []int32) { func (o XmlItem) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.AttributeString != nil { + if !isNil(o.AttributeString) { toSerialize["attribute_string"] = o.AttributeString } - if o.AttributeNumber != nil { + if !isNil(o.AttributeNumber) { toSerialize["attribute_number"] = o.AttributeNumber } - if o.AttributeInteger != nil { + if !isNil(o.AttributeInteger) { toSerialize["attribute_integer"] = o.AttributeInteger } - if o.AttributeBoolean != nil { + if !isNil(o.AttributeBoolean) { toSerialize["attribute_boolean"] = o.AttributeBoolean } - if o.WrappedArray != nil { + if !isNil(o.WrappedArray) { toSerialize["wrapped_array"] = o.WrappedArray } - if o.NameString != nil { + if !isNil(o.NameString) { toSerialize["name_string"] = o.NameString } - if o.NameNumber != nil { + if !isNil(o.NameNumber) { toSerialize["name_number"] = o.NameNumber } - if o.NameInteger != nil { + if !isNil(o.NameInteger) { toSerialize["name_integer"] = o.NameInteger } - if o.NameBoolean != nil { + if !isNil(o.NameBoolean) { toSerialize["name_boolean"] = o.NameBoolean } - if o.NameArray != nil { + if !isNil(o.NameArray) { toSerialize["name_array"] = o.NameArray } - if o.NameWrappedArray != nil { + if !isNil(o.NameWrappedArray) { toSerialize["name_wrapped_array"] = o.NameWrappedArray } - if o.PrefixString != nil { + if !isNil(o.PrefixString) { toSerialize["prefix_string"] = o.PrefixString } - if o.PrefixNumber != nil { + if !isNil(o.PrefixNumber) { toSerialize["prefix_number"] = o.PrefixNumber } - if o.PrefixInteger != nil { + if !isNil(o.PrefixInteger) { toSerialize["prefix_integer"] = o.PrefixInteger } - if o.PrefixBoolean != nil { + if !isNil(o.PrefixBoolean) { toSerialize["prefix_boolean"] = o.PrefixBoolean } - if o.PrefixArray != nil { + if !isNil(o.PrefixArray) { toSerialize["prefix_array"] = o.PrefixArray } - if o.PrefixWrappedArray != nil { + if !isNil(o.PrefixWrappedArray) { toSerialize["prefix_wrapped_array"] = o.PrefixWrappedArray } - if o.NamespaceString != nil { + if !isNil(o.NamespaceString) { toSerialize["namespace_string"] = o.NamespaceString } - if o.NamespaceNumber != nil { + if !isNil(o.NamespaceNumber) { toSerialize["namespace_number"] = o.NamespaceNumber } - if o.NamespaceInteger != nil { + if !isNil(o.NamespaceInteger) { toSerialize["namespace_integer"] = o.NamespaceInteger } - if o.NamespaceBoolean != nil { + if !isNil(o.NamespaceBoolean) { toSerialize["namespace_boolean"] = o.NamespaceBoolean } - if o.NamespaceArray != nil { + if !isNil(o.NamespaceArray) { toSerialize["namespace_array"] = o.NamespaceArray } - if o.NamespaceWrappedArray != nil { + if !isNil(o.NamespaceWrappedArray) { toSerialize["namespace_wrapped_array"] = o.NamespaceWrappedArray } - if o.PrefixNsString != nil { + if !isNil(o.PrefixNsString) { toSerialize["prefix_ns_string"] = o.PrefixNsString } - if o.PrefixNsNumber != nil { + if !isNil(o.PrefixNsNumber) { toSerialize["prefix_ns_number"] = o.PrefixNsNumber } - if o.PrefixNsInteger != nil { + if !isNil(o.PrefixNsInteger) { toSerialize["prefix_ns_integer"] = o.PrefixNsInteger } - if o.PrefixNsBoolean != nil { + if !isNil(o.PrefixNsBoolean) { toSerialize["prefix_ns_boolean"] = o.PrefixNsBoolean } - if o.PrefixNsArray != nil { + if !isNil(o.PrefixNsArray) { toSerialize["prefix_ns_array"] = o.PrefixNsArray } - if o.PrefixNsWrappedArray != nil { + if !isNil(o.PrefixNsWrappedArray) { toSerialize["prefix_ns_wrapped_array"] = o.PrefixNsWrappedArray } return json.Marshal(toSerialize) diff --git a/samples/client/petstore/go/go-petstore/utils.go b/samples/client/petstore/go/go-petstore/utils.go index db7f0c4651d..866bbf7f1eb 100644 --- a/samples/client/petstore/go/go-petstore/utils.go +++ b/samples/client/petstore/go/go-petstore/utils.go @@ -12,6 +12,7 @@ package petstore import ( "encoding/json" + "reflect" "time" ) @@ -326,3 +327,17 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + +// isNil checks if an input is nil +func isNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 80c1125f22e..16c9dca0ae8 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -1976,6 +1976,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -1985,6 +1986,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2004,6 +2006,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2076,6 +2079,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2087,6 +2091,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2098,6 +2103,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/apache-httpclient/api/openapi.yaml +++ b/samples/client/petstore/java/apache-httpclient/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/apache-httpclient/build.gradle b/samples/client/petstore/java/apache-httpclient/build.gradle index 493c2b4cd32..f344755af48 100644 --- a/samples/client/petstore/java/apache-httpclient/build.gradle +++ b/samples/client/petstore/java/apache-httpclient/build.gradle @@ -114,9 +114,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.12.6" - jackson_databind_version = "2.12.6.1" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" httpclient_version = "4.5.13" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/apache-httpclient/pom.xml b/samples/client/petstore/java/apache-httpclient/pom.xml index b99c8eb2565..a806edc02f7 100644 --- a/samples/client/petstore/java/apache-httpclient/pom.xml +++ b/samples/client/petstore/java/apache-httpclient/pom.xml @@ -277,8 +277,8 @@ UTF-8 1.5.21 4.5.13 - 2.12.6 - 2.12.6.1 + 2.13.4 + 2.13.4.2 1.3.5 1.0.0 4.13.2 diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml b/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml +++ b/samples/client/petstore/java/feign-no-nullable/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/feign-no-nullable/build.gradle b/samples/client/petstore/java/feign-no-nullable/build.gradle index 634a6cc1f8e..2458ad0c1d3 100644 --- a/samples/client/petstore/java/feign-no-nullable/build.gradle +++ b/samples/client/petstore/java/feign-no-nullable/build.gradle @@ -102,8 +102,8 @@ test { ext { swagger_annotations_version = "1.5.24" - jackson_version = "2.12.6.1" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" jakarta_annotation_version = "1.3.5" feign_version = "10.11" feign_form_version = "3.8.0" diff --git a/samples/client/petstore/java/feign-no-nullable/build.sbt b/samples/client/petstore/java/feign-no-nullable/build.sbt index 2f34b92238d..ffe35c367ac 100644 --- a/samples/client/petstore/java/feign-no-nullable/build.sbt +++ b/samples/client/petstore/java/feign-no-nullable/build.sbt @@ -16,9 +16,9 @@ lazy val root = (project in file(".")). "io.github.openfeign" % "feign-slf4j" % "10.11" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", "io.github.openfeign" % "feign-okhttp" % "10.11" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.6.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.12.6.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", diff --git a/samples/client/petstore/java/feign-no-nullable/pom.xml b/samples/client/petstore/java/feign-no-nullable/pom.xml index 7c6b5ebaf3e..45870d50120 100644 --- a/samples/client/petstore/java/feign-no-nullable/pom.xml +++ b/samples/client/petstore/java/feign-no-nullable/pom.xml @@ -325,8 +325,8 @@ 1.5.24 10.11 3.8.0 - 2.12.5 - 2.12.6.1 + 2.13.4 + 2.13.4.2 1.3.5 5.7.0 1.0.0 diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index 92180313221..625fbef7ea2 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -102,9 +102,9 @@ test { ext { swagger_annotations_version = "1.5.24" - jackson_version = "2.12.6.1" - jackson_databind_version = "2.12.6.1" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" feign_version = "10.11" feign_form_version = "3.8.0" diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index 5cb2a0ada75..7d2342bc7b5 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -16,9 +16,9 @@ lazy val root = (project in file(".")). "io.github.openfeign" % "feign-slf4j" % "10.11" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", "io.github.openfeign" % "feign-okhttp" % "10.11" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.6.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.12.6.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index 76ba9f3e0ad..483800f377b 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -330,9 +330,9 @@ 1.5.24 10.11 3.8.0 - 2.12.5 - 0.2.3 - 2.12.6.1 + 2.13.4 + 0.2.4 + 2.13.4.2 1.3.5 5.7.0 1.0.0 diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/google-api-client/api/openapi.yaml b/samples/client/petstore/java/google-api-client/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/google-api-client/api/openapi.yaml +++ b/samples/client/petstore/java/google-api-client/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index 7654b26933e..673eebf5351 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -98,9 +98,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.12.5" - jackson_databind_version = "2.12.6.1" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" google_api_client_version = "1.32.2" jersey_common_version = "2.25.1" diff --git a/samples/client/petstore/java/google-api-client/build.sbt b/samples/client/petstore/java/google-api-client/build.sbt index 90d48775fa7..85dd16c2334 100644 --- a/samples/client/petstore/java/google-api-client/build.sbt +++ b/samples/client/petstore/java/google-api-client/build.sbt @@ -12,9 +12,9 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.22", "com.google.api-client" % "google-api-client" % "1.23.0", "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", diff --git a/samples/client/petstore/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index 46de162441b..0de8a258a14 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -268,9 +268,9 @@ 1.5.22 1.32.2 2.25.1 - 2.12.5 - 2.12.6.1 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 1.0.0 4.13.2 diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/jersey1/api/openapi.yaml b/samples/client/petstore/java/jersey1/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/jersey1/api/openapi.yaml +++ b/samples/client/petstore/java/jersey1/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/jersey1/build.gradle b/samples/client/petstore/java/jersey1/build.gradle index 048109ddd8d..96a3c82649e 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -116,7 +116,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.12.6" jackson_databind_version = "2.12.6.1" - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" jersey_version = "1.19.4" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml b/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle index dcad5d5706c..0a446290dc1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle @@ -99,9 +99,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.2" - jackson_databind_version = "2.13.2.2" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "5.8.2" diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt b/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt index 75e5229352a..298ffac0e94 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt @@ -18,9 +18,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml index d6677e88904..a1e3c7dabae 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml @@ -340,9 +340,9 @@ UTF-8 1.6.5 2.35 - 2.13.2 - 2.13.2.2 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 5.8.2 8.3.1 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 951aa9d50a9..506ac25db7d 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 @@ -446,6 +446,22 @@ public class ApiClient extends JavaTimeFormatter { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link org.openapitools.client.ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + /** * Helper method to set the password flow for the first OAuth2 authentication. * diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/auth/OAuth.java index c55fb3793e2..69182323137 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/auth/OAuth.java @@ -169,6 +169,19 @@ public class OAuth implements Authentication { return this; } + public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe().debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe() + .build(authApi); + } + return this; + } + public OAuth usePasswordFlow(String username, String password) { this.flow = OAuthFlow.PASSWORD; this.username = username; diff --git a/samples/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/client/petstore/java/jersey2-java8/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index 9c76fdd54d3..f4084948039 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -99,9 +99,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.2" - jackson_databind_version = "2.13.2.2" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "5.8.2" diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index d584e09f730..96215c2ec48 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -18,9 +18,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 949e4712a54..31443a310f4 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -340,9 +340,9 @@ UTF-8 1.6.5 2.35 - 2.13.2 - 2.13.2.2 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 5.8.2 8.3.1 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 951aa9d50a9..506ac25db7d 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 @@ -446,6 +446,22 @@ public class ApiClient extends JavaTimeFormatter { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link org.openapitools.client.ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + /** * Helper method to set the password flow for the first OAuth2 authentication. * diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java index c55fb3793e2..69182323137 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java @@ -169,6 +169,19 @@ public class OAuth implements Authentication { return this; } + public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe().debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe() + .build(authApi); + } + return this; + } + public OAuth usePasswordFlow(String username, String password) { this.flow = OAuthFlow.PASSWORD; this.username = username; diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle index e7b8e76a76b..530f8dc1b1a 100644 --- a/samples/client/petstore/java/jersey3/build.gradle +++ b/samples/client/petstore/java/jersey3/build.gradle @@ -99,9 +99,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.2" - jackson_databind_version = "2.13.2.2" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "2.1.0" jersey_version = "3.0.4" junit_version = "5.8.2" diff --git a/samples/client/petstore/java/jersey3/build.sbt b/samples/client/petstore/java/jersey3/build.sbt index 7528f011df8..148e4e84810 100644 --- a/samples/client/petstore/java/jersey3/build.sbt +++ b/samples/client/petstore/java/jersey3/build.sbt @@ -16,11 +16,11 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", diff --git a/samples/client/petstore/java/jersey3/pom.xml b/samples/client/petstore/java/jersey3/pom.xml index 9f141fe9209..1041cb006b8 100644 --- a/samples/client/petstore/java/jersey3/pom.xml +++ b/samples/client/petstore/java/jersey3/pom.xml @@ -345,9 +345,9 @@ UTF-8 1.6.5 3.0.4 - 2.13.2 - 2.13.2.2 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 2.1.0 5.8.2 1.7 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 10170cec2b6..afce13bf9fa 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 @@ -530,6 +530,22 @@ public class ApiClient extends JavaTimeFormatter { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link org.openapitools.client.ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + /** * Helper method to set the password flow for the first OAuth2 authentication. * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java index adf880d90be..16d2c280c88 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java @@ -169,6 +169,19 @@ public class OAuth implements Authentication { return this; } + public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe().debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe() + .build(authApi); + } + return this; + } + public OAuth usePasswordFlow(String username, String password) { this.flow = OAuthFlow.PASSWORD; this.username = username; diff --git a/samples/client/petstore/java/native-async/api/openapi.yaml b/samples/client/petstore/java/native-async/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/native-async/api/openapi.yaml +++ b/samples/client/petstore/java/native-async/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/native-async/pom.xml b/samples/client/petstore/java/native-async/pom.xml index dcc052abc03..fc52b1606fc 100644 --- a/samples/client/petstore/java/native-async/pom.xml +++ b/samples/client/petstore/java/native-async/pom.xml @@ -215,7 +215,7 @@ 11 11 2.13.4 - 0.2.3 + 0.2.4 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/native/api/openapi.yaml b/samples/client/petstore/java/native/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/native/api/openapi.yaml +++ b/samples/client/petstore/java/native/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/native/pom.xml b/samples/client/petstore/java/native/pom.xml index dcc052abc03..fc52b1606fc 100644 --- a/samples/client/petstore/java/native/pom.xml +++ b/samples/client/petstore/java/native/pom.xml @@ -215,7 +215,7 @@ 11 11 2.13.4 - 0.2.3 + 0.2.4 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle index 1efaab58398..fbe2a2fc96a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle @@ -13,7 +13,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -65,7 +65,7 @@ if(hasProperty('target') && target == 'android') { task.from variant.javaCompile.destinationDir task.destinationDir = project.file("${project.buildDir}/outputs/jar") task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + artifacts.add('archives', task) } } @@ -106,22 +106,22 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.6.5' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.3' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3' - implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.8.5' implementation 'javax.ws.rs:jsr311-api:1.1.1' implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' - implementation 'org.openapitools:jackson-databind-nullable:0.2.3' - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.4' + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt index 8b24b9d91b1..7310d920be6 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt @@ -10,20 +10,21 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.6.5", - "com.squareup.okhttp3" % "okhttp" % "4.9.3", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.3", - "com.google.code.gson" % "gson" % "2.9.0", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", "org.apache.commons" % "commons-lang3" % "3.12.0", "javax.ws.rs" % "jsr311-api" % "1.1.1", "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.30" % "compile" "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" ) ) diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml index e98afcb453c..91f20c160f1 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.1.0 enforce-maven @@ -93,6 +93,7 @@ maven-dependency-plugin + 3.3.0 package @@ -109,7 +110,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -123,7 +124,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -154,7 +155,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.2 + 3.4.1 attach-javadocs @@ -177,7 +178,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.2.1 attach-sources @@ -291,7 +292,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.client - 1.0.1 + 1.0.2 org.apache.commons @@ -350,17 +351,17 @@ ${java.version} 1.8.5 1.6.5 - 4.9.3 - 2.9.0 + 4.10.0 + 2.9.1 3.12.0 - 0.2.3 + 0.2.4 1.3.5 - 5.8.2 - 1.6.2 + 5.9.1 + 1.9.1 3.12.4 2.1.1 1.1.1 UTF-8 - 2.21.0 + 2.27.2 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java index 8d71d33a956..fc569591c37 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java @@ -371,7 +371,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); + JSON.setDateFormat(dateFormat); return this; } @@ -382,7 +382,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); + JSON.setSqlDateFormat(dateFormat); return this; } @@ -393,7 +393,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); + JSON.setOffsetDateTimeFormat(dateFormat); return this; } @@ -404,7 +404,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -415,7 +415,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + JSON.setLenientOnJson(lenientOnJson); return this; } @@ -696,7 +696,7 @@ public class ApiClient { return ""; } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -704,7 +704,7 @@ public class ApiClient { if (b.length() > 0) { b.append(","); } - b.append(String.valueOf(o)); + b.append(o); } return b.toString(); } else { @@ -943,7 +943,7 @@ public class ApiClient { contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; @@ -977,13 +977,13 @@ public class ApiClient { } else if (isJsonMime(contentType)) { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } @@ -1456,7 +1456,7 @@ public class ApiClient { } else { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } @@ -1534,7 +1534,7 @@ public class ApiClient { KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); + String certificateAlias = "ca" + (index++); caKeyStore.setCertificateEntry(certificateAlias, certificate); } trustManagerFactory.init(caKeyStore); @@ -1608,7 +1608,7 @@ public class ApiClient { if (entry.getKey().equals(param.getName())) { switch (param.getIn()) { case "path": - path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString())); + path = path.replace("{" + param.getName() + "}", escapeString(value.toString())); break; case "query": if (value instanceof Collection) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 5125520afda..59fedc2a359 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -143,15 +143,12 @@ public class AnotherFakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling call123testSpecialTags(Async)"); } - - okhttp3.Call localVarCall = call123testSpecialTagsCall(body, _callback); - return localVarCall; + return call123testSpecialTagsCall(body, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java index 48d54b5cd8b..36dc208a26c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java @@ -130,7 +130,6 @@ public class FakeApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -138,7 +137,12 @@ public class FakeApi { } 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" + "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 = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -151,15 +155,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call createXmlItemValidateBeforeCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'xmlItem' is set if (xmlItem == null) { throw new ApiException("Missing the required parameter 'xmlItem' when calling createXmlItem(Async)"); } - - okhttp3.Call localVarCall = createXmlItemCall(xmlItem, _callback); - return localVarCall; + return createXmlItemCall(xmlItem, _callback); } @@ -268,7 +269,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -281,10 +281,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterBooleanSerializeCall(body, _callback); - return localVarCall; + return fakeOuterBooleanSerializeCall(body, _callback); } @@ -397,7 +394,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -410,10 +406,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterCompositeSerializeCall(body, _callback); - return localVarCall; + return fakeOuterCompositeSerializeCall(body, _callback); } @@ -526,7 +519,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -539,10 +531,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterNumberSerializeCall(body, _callback); - return localVarCall; + return fakeOuterNumberSerializeCall(body, _callback); } @@ -655,7 +644,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -668,10 +656,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterStringSerializeValidateBeforeCall(String body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterStringSerializeCall(body, _callback); - return localVarCall; + return fakeOuterStringSerializeCall(body, _callback); } @@ -776,7 +761,6 @@ public class FakeApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -797,15 +781,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling testBodyWithFileSchema(Async)"); } - - okhttp3.Call localVarCall = testBodyWithFileSchemaCall(body, _callback); - return localVarCall; + return testBodyWithFileSchemaCall(body, _callback); } @@ -908,7 +889,6 @@ public class FakeApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -929,20 +909,17 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testBodyWithQueryParamsValidateBeforeCall(String query, User body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'query' is set if (query == null) { throw new ApiException("Missing the required parameter 'query' when calling testBodyWithQueryParams(Async)"); } - + // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling testBodyWithQueryParams(Async)"); } - - okhttp3.Call localVarCall = testBodyWithQueryParamsCall(query, body, _callback); - return localVarCall; + return testBodyWithQueryParamsCall(query, body, _callback); } @@ -1067,15 +1044,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testClientModelValidateBeforeCall(Client body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)"); } - - okhttp3.Call localVarCall = testClientModelCall(body, _callback); - return localVarCall; + return testClientModelCall(body, _callback); } @@ -1250,7 +1224,6 @@ public class FakeApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1271,30 +1244,27 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'number' is set if (number == null) { throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)"); } - + // verify the required parameter '_double' is set if (_double == null) { throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)"); } - + // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) { throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)"); } - + // verify the required parameter '_byte' is set if (_byte == null) { throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)"); } - - okhttp3.Call localVarCall = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback); - return localVarCall; + return testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback); } @@ -1459,7 +1429,6 @@ public class FakeApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1480,10 +1449,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testEnumParametersValidateBeforeCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback); - return localVarCall; + return testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback); } @@ -1602,7 +1568,6 @@ public class FakeApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1610,7 +1575,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1623,25 +1587,22 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testGroupParametersValidateBeforeCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { throw new ApiException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters(Async)"); } - + // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup == null) { throw new ApiException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters(Async)"); } - + // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group == null) { throw new ApiException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters(Async)"); } - - okhttp3.Call localVarCall = testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); - return localVarCall; + return testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); } @@ -1822,7 +1783,6 @@ public class FakeApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1843,15 +1803,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testInlineAdditionalPropertiesValidateBeforeCall(Map param, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'param' is set if (param == null) { throw new ApiException("Missing the required parameter 'param' when calling testInlineAdditionalProperties(Async)"); } - - okhttp3.Call localVarCall = testInlineAdditionalPropertiesCall(param, _callback); - return localVarCall; + return testInlineAdditionalPropertiesCall(param, _callback); } @@ -1961,7 +1918,6 @@ public class FakeApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1982,20 +1938,17 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testJsonFormDataValidateBeforeCall(String param, String param2, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'param' is set if (param == null) { throw new ApiException("Missing the required parameter 'param' when calling testJsonFormData(Async)"); } - + // verify the required parameter 'param2' is set if (param2 == null) { throw new ApiException("Missing the required parameter 'param2' when calling testJsonFormData(Async)"); } - - okhttp3.Call localVarCall = testJsonFormDataCall(param, param2, _callback); - return localVarCall; + return testJsonFormDataCall(param, param2, _callback); } @@ -2108,7 +2061,6 @@ public class FakeApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -2116,7 +2068,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -2129,35 +2080,32 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testQueryParameterCollectionFormatValidateBeforeCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pipe' is set if (pipe == null) { throw new ApiException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'ioutil' is set if (ioutil == null) { throw new ApiException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'http' is set if (http == null) { throw new ApiException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'url' is set if (url == null) { throw new ApiException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'context' is set if (context == null) { throw new ApiException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat(Async)"); } - - okhttp3.Call localVarCall = testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); - return localVarCall; + return testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index c7c5ed97a8c..6d457492a9b 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -143,15 +143,12 @@ public class FakeClassnameTags123Api { @SuppressWarnings("rawtypes") private okhttp3.Call testClassnameValidateBeforeCall(Client body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling testClassname(Async)"); } - - okhttp3.Call localVarCall = testClassnameCall(body, _callback); - return localVarCall; + return testClassnameCall(body, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java index 2346d1de707..031970653d1 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java @@ -126,7 +126,6 @@ public class PetApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -134,7 +133,8 @@ public class PetApi { } final String[] localVarContentTypes = { - "application/json", "application/xml" + "application/json", + "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -147,15 +147,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call addPetValidateBeforeCall(Pet body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling addPet(Async)"); } - - okhttp3.Call localVarCall = addPetCall(body, _callback); - return localVarCall; + return addPetCall(body, _callback); } @@ -263,7 +260,6 @@ public class PetApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -271,7 +267,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -284,15 +279,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)"); } - - okhttp3.Call localVarCall = deletePetCall(petId, apiKey, _callback); - return localVarCall; + return deletePetCall(petId, apiKey, _callback); } @@ -401,7 +393,8 @@ public class PetApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -409,7 +402,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -422,15 +414,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call findPetsByStatusValidateBeforeCall(List status, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'status' is set if (status == null) { throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)"); } - - okhttp3.Call localVarCall = findPetsByStatusCall(status, _callback); - return localVarCall; + return findPetsByStatusCall(status, _callback); } @@ -542,7 +531,8 @@ public class PetApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -550,7 +540,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -564,15 +553,12 @@ public class PetApi { @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call findPetsByTagsValidateBeforeCall(Set tags, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'tags' is set if (tags == null) { throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)"); } - - okhttp3.Call localVarCall = findPetsByTagsCall(tags, _callback); - return localVarCall; + return findPetsByTagsCall(tags, _callback); } @@ -689,7 +675,8 @@ public class PetApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -697,7 +684,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -710,15 +696,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call getPetByIdValidateBeforeCall(Long petId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)"); } - - okhttp3.Call localVarCall = getPetByIdCall(petId, _callback); - return localVarCall; + return getPetByIdCall(petId, _callback); } @@ -832,7 +815,6 @@ public class PetApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -840,7 +822,8 @@ public class PetApi { } final String[] localVarContentTypes = { - "application/json", "application/xml" + "application/json", + "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -853,15 +836,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call updatePetValidateBeforeCall(Pet body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling updatePet(Async)"); } - - okhttp3.Call localVarCall = updatePetCall(body, _callback); - return localVarCall; + return updatePetCall(body, _callback); } @@ -982,7 +962,6 @@ public class PetApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1003,15 +982,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)"); } - - okhttp3.Call localVarCall = updatePetWithFormCall(petId, name, status, _callback); - return localVarCall; + return updatePetWithFormCall(petId, name, status, _callback); } @@ -1150,15 +1126,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)"); } - - okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, _file, _callback); - return localVarCall; + return uploadFileCall(petId, additionalMetadata, _file, _callback); } @@ -1301,20 +1274,17 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call uploadFileWithRequiredFileValidateBeforeCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile(Async)"); } - + // verify the required parameter 'requiredFile' is set if (requiredFile == null) { throw new ApiException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile(Async)"); } - - okhttp3.Call localVarCall = uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, _callback); - return localVarCall; + return uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java index dea0a6e4aaf..e329b700806 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java @@ -124,7 +124,6 @@ public class StoreApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -132,7 +131,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -145,15 +143,12 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call deleteOrderValidateBeforeCall(String orderId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)"); } - - okhttp3.Call localVarCall = deleteOrderCall(orderId, _callback); - return localVarCall; + return deleteOrderCall(orderId, _callback); } @@ -264,7 +259,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -277,10 +271,7 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call getInventoryValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getInventoryCall(_callback); - return localVarCall; + return getInventoryCall(_callback); } @@ -385,7 +376,8 @@ public class StoreApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -393,7 +385,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -406,15 +397,12 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call getOrderByIdValidateBeforeCall(Long orderId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)"); } - - okhttp3.Call localVarCall = getOrderByIdCall(orderId, _callback); - return localVarCall; + return getOrderByIdCall(orderId, _callback); } @@ -526,7 +514,8 @@ public class StoreApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -534,7 +523,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -547,15 +535,12 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call placeOrderValidateBeforeCall(Order body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling placeOrder(Async)"); } - - okhttp3.Call localVarCall = placeOrderCall(body, _callback); - return localVarCall; + return placeOrderCall(body, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java index cc6742339d5..b9f0f5df534 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java @@ -123,7 +123,6 @@ public class UserApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -131,7 +130,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -144,15 +142,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call createUserValidateBeforeCall(User body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createUser(Async)"); } - - okhttp3.Call localVarCall = createUserCall(body, _callback); - return localVarCall; + return createUserCall(body, _callback); } @@ -253,7 +248,6 @@ public class UserApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -261,7 +255,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -274,15 +267,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createUsersWithArrayInput(Async)"); } - - okhttp3.Call localVarCall = createUsersWithArrayInputCall(body, _callback); - return localVarCall; + return createUsersWithArrayInputCall(body, _callback); } @@ -383,7 +373,6 @@ public class UserApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -391,7 +380,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -404,15 +392,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call createUsersWithListInputValidateBeforeCall(List body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createUsersWithListInput(Async)"); } - - okhttp3.Call localVarCall = createUsersWithListInputCall(body, _callback); - return localVarCall; + return createUsersWithListInputCall(body, _callback); } @@ -515,7 +500,6 @@ public class UserApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -523,7 +507,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -536,15 +519,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call deleteUserValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)"); } - - okhttp3.Call localVarCall = deleteUserCall(username, _callback); - return localVarCall; + return deleteUserCall(username, _callback); } @@ -651,7 +631,8 @@ public class UserApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -659,7 +640,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -672,15 +652,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call getUserByNameValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)"); } - - okhttp3.Call localVarCall = getUserByNameCall(username, _callback); - return localVarCall; + return getUserByNameCall(username, _callback); } @@ -795,7 +772,8 @@ public class UserApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -803,7 +781,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -816,20 +793,17 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call loginUserValidateBeforeCall(String username, String password, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)"); } - + // verify the required parameter 'password' is set if (password == null) { throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)"); } - - okhttp3.Call localVarCall = loginUserCall(username, password, _callback); - return localVarCall; + return loginUserCall(username, password, _callback); } @@ -939,7 +913,6 @@ public class UserApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -947,7 +920,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -960,10 +932,7 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call logoutUserValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = logoutUserCall(_callback); - return localVarCall; + return logoutUserCall(_callback); } @@ -1064,7 +1033,6 @@ public class UserApi { localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1072,7 +1040,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1085,20 +1052,17 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call updateUserValidateBeforeCall(String username, User body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); } - + // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling updateUser(Async)"); } - - okhttp3.Call localVarCall = updateUserCall(username, body, _callback); - return localVarCall; + return updateUserCall(username, body, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java index 1c8ac2dc0cc..d266db0e95a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java @@ -55,6 +55,7 @@ public class OAuthOkHttpClient implements HttpClient { response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index 2bd61d7fe8a..8cbe8f9e743 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -65,8 +65,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { .setClientSecret(clientSecret)); setFlow(flow); if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); } } } @@ -129,8 +129,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { } Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); } requestBuilder.url(oAuthRequest.getLocationUri()); diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f0821e6d220..eb2a6d8d240 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 598684e4263..1614f9f52a2 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -39,6 +39,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index c3b5720d76f..d5ad761ad3d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index dd6a62ee0c2..4ae609e18da 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -42,6 +42,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index ee165d80b92..da1266a541b 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 717fbfada16..223646510e2 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -39,6 +39,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index ab3903887bb..65aec03e645 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -39,6 +39,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8e202f0b3c1..71cf4e626bf 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -38,6 +38,7 @@ 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; 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 6544aafe659..6dc48c1bbb1 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 @@ -41,6 +41,7 @@ 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; 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 bb2bc0b8eb5..036b665fa3d 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 @@ -41,6 +41,7 @@ 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; @@ -161,8 +162,8 @@ public class ArrayOfArrayOfNumberOnly { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - // ensure the json data is an array - if (!jsonObj.get("ArrayArrayNumber").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("ArrayArrayNumber") != null && !jsonObj.get("ArrayArrayNumber").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `ArrayArrayNumber` to be an array in the JSON string but got `%s`", jsonObj.get("ArrayArrayNumber").toString())); } } 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 ead80432286..d15079de533 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 @@ -41,6 +41,7 @@ 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; @@ -161,8 +162,8 @@ public class ArrayOfNumberOnly { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - // ensure the json data is an array - if (!jsonObj.get("ArrayNumber").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("ArrayNumber") != null && !jsonObj.get("ArrayNumber").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `ArrayNumber` to be an array in the JSON string but got `%s`", jsonObj.get("ArrayNumber").toString())); } } 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 fcbe1518777..499ebb49067 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 @@ -41,6 +41,7 @@ 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; @@ -237,16 +238,16 @@ public class ArrayTest { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - // ensure the json data is an array - if (!jsonObj.get("array_of_string").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_of_string") != null && !jsonObj.get("array_of_string").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_of_string` to be an array in the JSON string but got `%s`", jsonObj.get("array_of_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_array_of_integer").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_array_of_integer") != null && !jsonObj.get("array_array_of_integer").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_array_of_integer` to be an array in the JSON string but got `%s`", jsonObj.get("array_array_of_integer").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_array_of_model").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_array_of_model") != null && !jsonObj.get("array_array_of_model").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_array_of_model` to be an array in the JSON string but got `%s`", jsonObj.get("array_array_of_model").toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java index e1891f74336..5ae48a228cc 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCat.java @@ -39,6 +39,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java index dfd9b1cfa8d..a7fe5fef644 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java index a21f9ddcd6b..ea1bb183378 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Capitalization.java @@ -38,6 +38,7 @@ 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; 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 d264d6a7af2..d987930b97b 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 @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java index f870e77805b..0945736930c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java index c2ccf6ae911..c9bac8f1925 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Category.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java index 77e036027c1..d4bc8ca3d80 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java index feac9e3039d..47ed2129446 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Client.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java index 849e96210e2..cc43b3ea746 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Dog.java @@ -39,6 +39,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java index a061ea3c442..93f2a575815 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -38,6 +38,7 @@ 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; 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 31615796fbb..32c663113ae 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 @@ -40,6 +40,7 @@ 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; @@ -287,8 +288,8 @@ public class EnumArrays { if ((jsonObj.get("just_symbol") != null && !jsonObj.get("just_symbol").isJsonNull()) && !jsonObj.get("just_symbol").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `just_symbol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("just_symbol").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_enum").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_enum") != null && !jsonObj.get("array_enum").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_enum` to be an array in the JSON string but got `%s`", jsonObj.get("array_enum").toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java index 7d1cf66794e..1d2cd63632f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java @@ -39,6 +39,7 @@ 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; 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 4b1c10290b0..e14910fbedd 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 @@ -41,6 +41,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java index 06d9058cdb4..70ec7325464 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/FormatTest.java @@ -43,6 +43,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index ab2d43afecd..a27171e3e32 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java index 9612c2799af..a269036d040 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MapTest.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b8969e5d78f..ba4591b41cb 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -43,6 +43,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java index 62479b4171e..79e491d7ed8 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java index cecce9bf053..ed23154b439 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java index 0271d19ec3b..6bd1d38dcb1 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java index ab6232a79b8..db413a44d2a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java index 9412d6d0928..9f66bbfaf1a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java index 2db548e4bd9..0ef25fe3caa 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Name.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java index 6d8fcba7d9b..7ebee8aaf68 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -39,6 +39,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java index cdf57447250..ca8923a7e0d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Order.java @@ -39,6 +39,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java index b0f22f90982..9ab690cd362 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -39,6 +39,7 @@ 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; 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 0f91e98f35e..45efe2fd227 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 @@ -44,6 +44,7 @@ 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; @@ -384,8 +385,10 @@ public class Pet { if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - // ensure the json data is an array - if ((jsonObj.get("photoUrls") != null && !jsonObj.get("photoUrls").isJsonNull()) && !jsonObj.get("photoUrls").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("photoUrls") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("photoUrls").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj.get("photoUrls").toString())); } if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 5a8b18873dc..d804f480e7d 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java index bdacd2ce180..3b2da3bcc0c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java index 03b119d303e..d1ab9566632 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/Tag.java @@ -38,6 +38,7 @@ 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; 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 8966c713679..05d4d4ba427 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 @@ -41,6 +41,7 @@ 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; @@ -293,8 +294,10 @@ public class TypeHolderDefault { if (!jsonObj.get("string_item").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `string_item` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_item").toString())); } - // ensure the json data is an array - if ((jsonObj.get("array_item") != null && !jsonObj.get("array_item").isJsonNull()) && !jsonObj.get("array_item").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("array_item") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("array_item").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_item` to be an array in the JSON string but got `%s`", jsonObj.get("array_item").toString())); } } 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 5023112e2a7..eed7740f2c7 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 @@ -41,6 +41,7 @@ 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; @@ -324,8 +325,10 @@ public class TypeHolderExample { if (!jsonObj.get("string_item").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `string_item` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_item").toString())); } - // ensure the json data is an array - if ((jsonObj.get("array_item") != null && !jsonObj.get("array_item").isJsonNull()) && !jsonObj.get("array_item").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("array_item") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("array_item").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_item` to be an array in the JSON string but got `%s`", jsonObj.get("array_item").toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java index d07c822002a..3aca9ed3f99 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/User.java @@ -38,6 +38,7 @@ 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; 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 c7af7a8dcd2..090663e6833 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 @@ -41,6 +41,7 @@ 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; @@ -1068,52 +1069,52 @@ public class XmlItem { if ((jsonObj.get("attribute_string") != null && !jsonObj.get("attribute_string").isJsonNull()) && !jsonObj.get("attribute_string").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `attribute_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attribute_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("wrapped_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("wrapped_array") != null && !jsonObj.get("wrapped_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("wrapped_array").toString())); } if ((jsonObj.get("name_string") != null && !jsonObj.get("name_string").isJsonNull()) && !jsonObj.get("name_string").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("name_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("name_array") != null && !jsonObj.get("name_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `name_array` to be an array in the JSON string but got `%s`", jsonObj.get("name_array").toString())); } - // ensure the json data is an array - if (!jsonObj.get("name_wrapped_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("name_wrapped_array") != null && !jsonObj.get("name_wrapped_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `name_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("name_wrapped_array").toString())); } if ((jsonObj.get("prefix_string") != null && !jsonObj.get("prefix_string").isJsonNull()) && !jsonObj.get("prefix_string").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("prefix_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("prefix_array") != null && !jsonObj.get("prefix_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_array").toString())); } - // ensure the json data is an array - if (!jsonObj.get("prefix_wrapped_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("prefix_wrapped_array") != null && !jsonObj.get("prefix_wrapped_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_wrapped_array").toString())); } if ((jsonObj.get("namespace_string") != null && !jsonObj.get("namespace_string").isJsonNull()) && !jsonObj.get("namespace_string").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("namespace_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("namespace_array") != null && !jsonObj.get("namespace_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_array` to be an array in the JSON string but got `%s`", jsonObj.get("namespace_array").toString())); } - // ensure the json data is an array - if (!jsonObj.get("namespace_wrapped_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("namespace_wrapped_array") != null && !jsonObj.get("namespace_wrapped_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("namespace_wrapped_array").toString())); } if ((jsonObj.get("prefix_ns_string") != null && !jsonObj.get("prefix_ns_string").isJsonNull()) && !jsonObj.get("prefix_ns_string").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix_ns_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("prefix_ns_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("prefix_ns_array") != null && !jsonObj.get("prefix_ns_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_ns_array").toString())); } - // ensure the json data is an array - if (!jsonObj.get("prefix_ns_wrapped_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("prefix_ns_wrapped_array") != null && !jsonObj.get("prefix_ns_wrapped_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_ns_wrapped_array").toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/resources/openapi/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle index a3b19dc1aa9..c4de7288d77 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle @@ -13,7 +13,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -65,7 +65,7 @@ if(hasProperty('target') && target == 'android') { task.from variant.javaCompile.destinationDir task.destinationDir = project.file("${project.buildDir}/outputs/jar") task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + artifacts.add('archives', task) } } @@ -106,21 +106,21 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.6.5' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.3' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3' - implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.8.5' implementation 'javax.ws.rs:jsr311-api:1.1.1' implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' - implementation 'org.openapitools:jackson-databind-nullable:0.2.3' - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.4' + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt b/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt index ab31d82e97e..9518e6cfbe3 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt @@ -10,19 +10,20 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.6.5", - "com.squareup.okhttp3" % "okhttp" % "4.9.3", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.3", - "com.google.code.gson" % "gson" % "2.9.0", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", "org.apache.commons" % "commons-lang3" % "3.12.0", "javax.ws.rs" % "jsr311-api" % "1.1.1", "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" ) ) diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml b/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml index f4e17f2a7c7..2f68a26372d 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.1.0 enforce-maven @@ -93,6 +93,7 @@ maven-dependency-plugin + 3.3.0 package @@ -109,7 +110,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -123,7 +124,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -154,7 +155,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.2 + 3.4.1 attach-javadocs @@ -177,7 +178,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.2.1 attach-sources @@ -291,7 +292,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.client - 1.0.1 + 1.0.2 org.apache.commons @@ -345,17 +346,17 @@ ${java.version} 1.8.5 1.6.5 - 4.9.3 - 2.9.0 + 4.10.0 + 2.9.1 3.12.0 - 0.2.3 + 0.2.4 1.3.5 - 5.8.2 - 1.6.2 + 5.9.1 + 1.9.1 3.12.4 2.1.1 1.1.1 UTF-8 - 2.21.0 + 2.27.2 diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ApiClient.java index 5eaec79750a..d9e3fe85b09 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ApiClient.java @@ -354,7 +354,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); + JSON.setDateFormat(dateFormat); return this; } @@ -365,7 +365,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); + JSON.setSqlDateFormat(dateFormat); return this; } @@ -376,7 +376,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); + JSON.setOffsetDateTimeFormat(dateFormat); return this; } @@ -387,7 +387,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -398,7 +398,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + JSON.setLenientOnJson(lenientOnJson); return this; } @@ -679,7 +679,7 @@ public class ApiClient { return ""; } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -687,7 +687,7 @@ public class ApiClient { if (b.length() > 0) { b.append(","); } - b.append(String.valueOf(o)); + b.append(o); } return b.toString(); } else { @@ -938,7 +938,7 @@ public class ApiClient { contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; @@ -972,13 +972,13 @@ public class ApiClient { } else if (isJsonMime(contentType)) { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } @@ -1451,7 +1451,7 @@ public class ApiClient { } else { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } @@ -1529,7 +1529,7 @@ public class ApiClient { KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); + String certificateAlias = "ca" + (index++); caKeyStore.setCertificateEntry(certificateAlias, certificate); } trustManagerFactory.init(caKeyStore); diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/api/PetApi.java index 395aa4d795e..1e0a4d7b479 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/api/PetApi.java @@ -101,7 +101,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -109,7 +110,8 @@ public class PetApi { } final String[] localVarContentTypes = { - "application/json", "application/xml" + "application/json", + "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -122,15 +124,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call addPetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pet' is set if (pet == null) { throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)"); } - - okhttp3.Call localVarCall = addPetCall(pet, _callback); - return localVarCall; + return addPetCall(pet, _callback); } @@ -253,7 +252,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -266,7 +265,6 @@ public class PetApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -274,7 +272,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -287,15 +284,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)"); } - - okhttp3.Call localVarCall = deletePetCall(petId, apiKey, _callback); - return localVarCall; + return deletePetCall(petId, apiKey, _callback); } @@ -432,7 +426,8 @@ public class PetApi { } final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -440,7 +435,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -453,15 +447,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call findPetsByStatusValidateBeforeCall(List status, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'status' is set if (status == null) { throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)"); } - - okhttp3.Call localVarCall = findPetsByStatusCall(status, _callback); - return localVarCall; + return findPetsByStatusCall(status, _callback); } @@ -596,7 +587,8 @@ public class PetApi { } final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -604,7 +596,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -618,15 +609,12 @@ public class PetApi { @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'tags' is set if (tags == null) { throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)"); } - - okhttp3.Call localVarCall = findPetsByTagsCall(tags, _callback); - return localVarCall; + return findPetsByTagsCall(tags, _callback); } @@ -759,7 +747,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -768,7 +756,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -776,7 +765,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -789,15 +777,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call getPetByIdValidateBeforeCall(Long petId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)"); } - - okhttp3.Call localVarCall = getPetByIdCall(petId, _callback); - return localVarCall; + return getPetByIdCall(petId, _callback); } @@ -933,7 +918,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -941,7 +927,8 @@ public class PetApi { } final String[] localVarContentTypes = { - "application/json", "application/xml" + "application/json", + "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -954,15 +941,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call updatePetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pet' is set if (pet == null) { throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)"); } - - okhttp3.Call localVarCall = updatePetCall(pet, _callback); - return localVarCall; + return updatePetCall(pet, _callback); } @@ -1109,7 +1093,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1126,7 +1110,6 @@ public class PetApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1147,15 +1130,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)"); } - - okhttp3.Call localVarCall = updatePetWithFormCall(petId, name, status, _callback); - return localVarCall; + return updatePetWithFormCall(petId, name, status, _callback); } @@ -1234,7 +1214,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1272,15 +1252,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)"); } - - okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, _file, _callback); - return localVarCall; + return uploadFileCall(petId, additionalMetadata, _file, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java index 1c8ac2dc0cc..d266db0e95a 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java @@ -55,6 +55,7 @@ public class OAuthOkHttpClient implements HttpClient { response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index 2bd61d7fe8a..8cbe8f9e743 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -65,8 +65,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { .setClientSecret(clientSecret)); setFlow(flow); if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); } } } @@ -129,8 +129,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { } Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); } requestBuilder.url(oAuthRequest.getLocationUri()); diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Category.java index ed709beb245..f1c2ab03588 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Category.java @@ -38,6 +38,7 @@ 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; @@ -116,6 +117,10 @@ public class Category { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Category instance itself */ public Category putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -127,6 +132,8 @@ public class Category { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -134,6 +141,9 @@ public class Category { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -267,8 +277,10 @@ public class Category { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 48e893219d4..1eddb844b19 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -38,6 +38,7 @@ 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; @@ -143,6 +144,10 @@ public class ModelApiResponse { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ModelApiResponse instance itself */ public ModelApiResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -154,6 +159,8 @@ public class ModelApiResponse { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -161,6 +168,9 @@ public class ModelApiResponse { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -300,8 +310,10 @@ public class ModelApiResponse { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Order.java index 5e9f5befa28..a88514fafee 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Order.java @@ -39,6 +39,7 @@ 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; @@ -274,6 +275,10 @@ public class Order { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Order instance itself */ public Order putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -285,6 +290,8 @@ public class Order { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -292,6 +299,9 @@ public class Order { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -437,8 +447,10 @@ public class Order { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 e1679b06656..13f03b976f5 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 @@ -42,6 +42,7 @@ 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; @@ -292,6 +293,10 @@ public class Pet { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Pet instance itself */ public Pet putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -303,6 +308,8 @@ public class Pet { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -310,6 +317,9 @@ public class Pet { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -414,8 +424,10 @@ public class Pet { if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - // ensure the json data is an array - if ((jsonObj.get("photoUrls") != null && !jsonObj.get("photoUrls").isJsonNull()) && !jsonObj.get("photoUrls").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("photoUrls") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("photoUrls").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj.get("photoUrls").toString())); } if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) { @@ -489,8 +501,10 @@ public class Pet { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Tag.java index 989a4742d23..29cf8fe79a1 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/Tag.java @@ -38,6 +38,7 @@ 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; @@ -116,6 +117,10 @@ public class Tag { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Tag instance itself */ public Tag putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -127,6 +132,8 @@ public class Tag { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -134,6 +141,9 @@ public class Tag { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -267,8 +277,10 @@ public class Tag { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/User.java index 0fc8d804f70..726c838cf32 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/src/main/java/org/openapitools/client/model/User.java @@ -38,6 +38,7 @@ 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; @@ -278,6 +279,10 @@ public class User { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the User instance itself */ public User putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -289,6 +294,8 @@ public class User { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -296,6 +303,9 @@ public class User { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -462,8 +472,10 @@ public class User { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index 77435c53101..898e75a6ec2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -13,7 +13,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -65,7 +65,7 @@ if(hasProperty('target') && target == 'android') { task.from variant.javaCompile.destinationDir task.destinationDir = project.file("${project.buildDir}/outputs/jar") task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + artifacts.add('archives', task) } } @@ -106,21 +106,21 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.6.5' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.3' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3' - implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.8.5' implementation 'javax.ws.rs:jsr311-api:1.1.1' implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' - implementation 'org.openapitools:jackson-databind-nullable:0.2.3' - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.4' + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index 341cd36f169..6675fd8d9e6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -10,19 +10,20 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.6.5", - "com.squareup.okhttp3" % "okhttp" % "4.9.3", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.3", - "com.google.code.gson" % "gson" % "2.9.0", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", "org.apache.commons" % "commons-lang3" % "3.12.0", "javax.ws.rs" % "jsr311-api" % "1.1.1", "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" ) ) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 857a2d94b1e..ecb33155475 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.1.0 enforce-maven @@ -93,6 +93,7 @@ maven-dependency-plugin + 3.3.0 package @@ -109,7 +110,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -123,7 +124,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -154,7 +155,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.2 + 3.4.1 attach-javadocs @@ -177,7 +178,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.2.1 attach-sources @@ -291,7 +292,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.client - 1.0.1 + 1.0.2 org.apache.commons @@ -352,17 +353,17 @@ ${java.version} 1.8.5 1.6.5 - 4.9.3 - 2.9.0 + 4.10.0 + 2.9.1 3.12.0 - 0.2.3 + 0.2.4 1.3.5 - 5.8.2 - 1.6.2 + 5.9.1 + 1.9.1 3.12.4 2.1.1 1.1.1 UTF-8 - 2.21.0 + 2.27.2 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index 54e9d332df0..04bb97a8dbe 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -360,7 +360,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); + JSON.setDateFormat(dateFormat); return this; } @@ -371,7 +371,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); + JSON.setSqlDateFormat(dateFormat); return this; } @@ -382,7 +382,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); + JSON.setOffsetDateTimeFormat(dateFormat); return this; } @@ -393,7 +393,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -404,7 +404,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + JSON.setLenientOnJson(lenientOnJson); return this; } @@ -685,7 +685,7 @@ public class ApiClient { return ""; } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -693,7 +693,7 @@ public class ApiClient { if (b.length() > 0) { b.append(","); } - b.append(String.valueOf(o)); + b.append(o); } return b.toString(); } else { @@ -944,7 +944,7 @@ public class ApiClient { contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; @@ -978,13 +978,13 @@ public class ApiClient { } else if (isJsonMime(contentType)) { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } @@ -1457,7 +1457,7 @@ public class ApiClient { } else { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } @@ -1535,7 +1535,7 @@ public class ApiClient { KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); + String certificateAlias = "ca" + (index++); caKeyStore.setCertificateEntry(certificateAlias, certificate); } trustManagerFactory.init(caKeyStore); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 0b95c9d7593..b9a463c411e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -132,15 +132,12 @@ public class AnotherFakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling call123testSpecialTags(Async)"); } - - okhttp3.Call localVarCall = call123testSpecialTagsCall(body, _callback); - return localVarCall; + return call123testSpecialTagsCall(body, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 4e91e597d77..6dfe38809b7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -119,7 +119,6 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -127,7 +126,12 @@ public class FakeApi { } 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" + "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 = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -140,15 +144,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call createXmlItemValidateBeforeCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'xmlItem' is set if (xmlItem == null) { throw new ApiException("Missing the required parameter 'xmlItem' when calling createXmlItem(Async)"); } - - okhttp3.Call localVarCall = createXmlItemCall(xmlItem, _callback); - return localVarCall; + return createXmlItemCall(xmlItem, _callback); } @@ -249,7 +250,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -262,10 +262,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterBooleanSerializeCall(body, _callback); - return localVarCall; + return fakeOuterBooleanSerializeCall(body, _callback); } @@ -370,7 +367,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -383,10 +379,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterCompositeSerializeCall(body, _callback); - return localVarCall; + return fakeOuterCompositeSerializeCall(body, _callback); } @@ -491,7 +484,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -504,10 +496,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterNumberSerializeCall(body, _callback); - return localVarCall; + return fakeOuterNumberSerializeCall(body, _callback); } @@ -612,7 +601,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -625,10 +613,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterStringSerializeValidateBeforeCall(String body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterStringSerializeCall(body, _callback); - return localVarCall; + return fakeOuterStringSerializeCall(body, _callback); } @@ -725,7 +710,6 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -746,15 +730,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling testBodyWithFileSchema(Async)"); } - - okhttp3.Call localVarCall = testBodyWithFileSchemaCall(body, _callback); - return localVarCall; + return testBodyWithFileSchemaCall(body, _callback); } @@ -852,7 +833,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -873,20 +853,17 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testBodyWithQueryParamsValidateBeforeCall(String query, User body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'query' is set if (query == null) { throw new ApiException("Missing the required parameter 'query' when calling testBodyWithQueryParams(Async)"); } - + // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling testBodyWithQueryParams(Async)"); } - - okhttp3.Call localVarCall = testBodyWithQueryParamsCall(query, body, _callback); - return localVarCall; + return testBodyWithQueryParamsCall(query, body, _callback); } @@ -1003,15 +980,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testClientModelValidateBeforeCall(Client body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)"); } - - okhttp3.Call localVarCall = testClientModelCall(body, _callback); - return localVarCall; + return testClientModelCall(body, _callback); } @@ -1178,7 +1152,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1199,30 +1172,27 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'number' is set if (number == null) { throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)"); } - + // verify the required parameter '_double' is set if (_double == null) { throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)"); } - + // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) { throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)"); } - + // verify the required parameter '_byte' is set if (_byte == null) { throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)"); } - - okhttp3.Call localVarCall = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback); - return localVarCall; + return testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback); } @@ -1397,7 +1367,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1418,10 +1387,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testEnumParametersValidateBeforeCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback); - return localVarCall; + return testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback); } @@ -1550,7 +1516,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1558,7 +1523,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1571,25 +1535,22 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testGroupParametersValidateBeforeCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { throw new ApiException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters(Async)"); } - + // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup == null) { throw new ApiException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters(Async)"); } - + // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group == null) { throw new ApiException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters(Async)"); } - - okhttp3.Call localVarCall = testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); - return localVarCall; + return testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); } @@ -1762,7 +1723,6 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1783,15 +1743,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testInlineAdditionalPropertiesValidateBeforeCall(Map param, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'param' is set if (param == null) { throw new ApiException("Missing the required parameter 'param' when calling testInlineAdditionalProperties(Async)"); } - - okhttp3.Call localVarCall = testInlineAdditionalPropertiesCall(param, _callback); - return localVarCall; + return testInlineAdditionalPropertiesCall(param, _callback); } @@ -1893,7 +1850,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1914,20 +1870,17 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testJsonFormDataValidateBeforeCall(String param, String param2, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'param' is set if (param == null) { throw new ApiException("Missing the required parameter 'param' when calling testJsonFormData(Async)"); } - + // verify the required parameter 'param2' is set if (param2 == null) { throw new ApiException("Missing the required parameter 'param2' when calling testJsonFormData(Async)"); } - - okhttp3.Call localVarCall = testJsonFormDataCall(param, param2, _callback); - return localVarCall; + return testJsonFormDataCall(param, param2, _callback); } @@ -2047,7 +2000,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -2055,7 +2007,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -2068,35 +2019,32 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testQueryParameterCollectionFormatValidateBeforeCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pipe' is set if (pipe == null) { throw new ApiException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'ioutil' is set if (ioutil == null) { throw new ApiException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'http' is set if (http == null) { throw new ApiException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'url' is set if (url == null) { throw new ApiException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'context' is set if (context == null) { throw new ApiException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat(Async)"); } - - okhttp3.Call localVarCall = testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); - return localVarCall; + return testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index f6eda4c553c..8e5c1348477 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -132,15 +132,12 @@ public class FakeClassnameTags123Api { @SuppressWarnings("rawtypes") private okhttp3.Call testClassnameValidateBeforeCall(Client body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling testClassname(Async)"); } - - okhttp3.Call localVarCall = testClassnameCall(body, _callback); - return localVarCall; + return testClassnameCall(body, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java index ee4c14afaae..9cc3e482211 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java @@ -115,7 +115,6 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -123,7 +122,8 @@ public class PetApi { } final String[] localVarContentTypes = { - "application/json", "application/xml" + "application/json", + "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -136,15 +136,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call addPetValidateBeforeCall(Pet body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling addPet(Async)"); } - - okhttp3.Call localVarCall = addPetCall(body, _callback); - return localVarCall; + return addPetCall(body, _callback); } @@ -234,7 +231,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -247,7 +244,6 @@ public class PetApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -255,7 +251,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -268,15 +263,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)"); } - - okhttp3.Call localVarCall = deletePetCall(petId, apiKey, _callback); - return localVarCall; + return deletePetCall(petId, apiKey, _callback); } @@ -380,7 +372,8 @@ public class PetApi { } final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -388,7 +381,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -401,15 +393,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call findPetsByStatusValidateBeforeCall(List status, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'status' is set if (status == null) { throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)"); } - - okhttp3.Call localVarCall = findPetsByStatusCall(status, _callback); - return localVarCall; + return findPetsByStatusCall(status, _callback); } @@ -516,7 +505,8 @@ public class PetApi { } final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -524,7 +514,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -538,15 +527,12 @@ public class PetApi { @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call findPetsByTagsValidateBeforeCall(Set tags, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'tags' is set if (tags == null) { throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)"); } - - okhttp3.Call localVarCall = findPetsByTagsCall(tags, _callback); - return localVarCall; + return findPetsByTagsCall(tags, _callback); } @@ -646,7 +632,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -655,7 +641,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -663,7 +650,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -676,15 +662,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call getPetByIdValidateBeforeCall(Long petId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)"); } - - okhttp3.Call localVarCall = getPetByIdCall(petId, _callback); - return localVarCall; + return getPetByIdCall(petId, _callback); } @@ -790,7 +773,6 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -798,7 +780,8 @@ public class PetApi { } final String[] localVarContentTypes = { - "application/json", "application/xml" + "application/json", + "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -811,15 +794,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call updatePetValidateBeforeCall(Pet body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling updatePet(Async)"); } - - okhttp3.Call localVarCall = updatePetCall(body, _callback); - return localVarCall; + return updatePetCall(body, _callback); } @@ -915,7 +895,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -932,7 +912,6 @@ public class PetApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -953,15 +932,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)"); } - - okhttp3.Call localVarCall = updatePetWithFormCall(petId, name, status, _callback); - return localVarCall; + return updatePetWithFormCall(petId, name, status, _callback); } @@ -1054,7 +1030,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1092,15 +1068,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)"); } - - okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, _file, _callback); - return localVarCall; + return uploadFileCall(petId, additionalMetadata, _file, _callback); } @@ -1197,7 +1170,7 @@ public class PetApi { // create path and map variables String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1235,20 +1208,17 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call uploadFileWithRequiredFileValidateBeforeCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile(Async)"); } - + // verify the required parameter 'requiredFile' is set if (requiredFile == null) { throw new ApiException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile(Async)"); } - - okhttp3.Call localVarCall = uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, _callback); - return localVarCall; + return uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java index 380dbea8cb5..ac429922b6d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java @@ -104,7 +104,7 @@ public class StoreApi { // create path and map variables String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); + .replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -113,7 +113,6 @@ public class StoreApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -121,7 +120,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -134,15 +132,12 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call deleteOrderValidateBeforeCall(String orderId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)"); } - - okhttp3.Call localVarCall = deleteOrderCall(orderId, _callback); - return localVarCall; + return deleteOrderCall(orderId, _callback); } @@ -245,7 +240,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -258,10 +252,7 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call getInventoryValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getInventoryCall(_callback); - return localVarCall; + return getInventoryCall(_callback); } @@ -349,7 +340,7 @@ public class StoreApi { // create path and map variables String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); + .replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -358,7 +349,8 @@ public class StoreApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -366,7 +358,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -379,15 +370,12 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call getOrderByIdValidateBeforeCall(Long orderId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)"); } - - okhttp3.Call localVarCall = getOrderByIdCall(orderId, _callback); - return localVarCall; + return getOrderByIdCall(orderId, _callback); } @@ -491,7 +479,8 @@ public class StoreApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -499,7 +488,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -512,15 +500,12 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call placeOrderValidateBeforeCall(Order body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling placeOrder(Async)"); } - - okhttp3.Call localVarCall = placeOrderCall(body, _callback); - return localVarCall; + return placeOrderCall(body, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java index 58f08ee3ace..8827ee27149 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java @@ -112,7 +112,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -120,7 +119,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -133,15 +131,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call createUserValidateBeforeCall(User body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createUser(Async)"); } - - okhttp3.Call localVarCall = createUserCall(body, _callback); - return localVarCall; + return createUserCall(body, _callback); } @@ -234,7 +229,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -242,7 +236,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -255,15 +248,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createUsersWithArrayInput(Async)"); } - - okhttp3.Call localVarCall = createUsersWithArrayInputCall(body, _callback); - return localVarCall; + return createUsersWithArrayInputCall(body, _callback); } @@ -356,7 +346,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -364,7 +353,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -377,15 +365,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call createUsersWithListInputValidateBeforeCall(List body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createUsersWithListInput(Async)"); } - - okhttp3.Call localVarCall = createUsersWithListInputCall(body, _callback); - return localVarCall; + return createUsersWithListInputCall(body, _callback); } @@ -471,7 +456,7 @@ public class UserApi { // create path and map variables String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -480,7 +465,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -488,7 +472,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -501,15 +484,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call deleteUserValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)"); } - - okhttp3.Call localVarCall = deleteUserCall(username, _callback); - return localVarCall; + return deleteUserCall(username, _callback); } @@ -599,7 +579,7 @@ public class UserApi { // create path and map variables String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -608,7 +588,8 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -616,7 +597,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -629,15 +609,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call getUserByNameValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)"); } - - okhttp3.Call localVarCall = getUserByNameCall(username, _callback); - return localVarCall; + return getUserByNameCall(username, _callback); } @@ -750,7 +727,8 @@ public class UserApi { } final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -758,7 +736,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -771,20 +748,17 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call loginUserValidateBeforeCall(String username, String password, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)"); } - + // verify the required parameter 'password' is set if (password == null) { throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)"); } - - okhttp3.Call localVarCall = loginUserCall(username, password, _callback); - return localVarCall; + return loginUserCall(username, password, _callback); } @@ -886,7 +860,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -894,7 +867,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -907,10 +879,7 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call logoutUserValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = logoutUserCall(_callback); - return localVarCall; + return logoutUserCall(_callback); } @@ -994,7 +963,7 @@ public class UserApi { // create path and map variables String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1003,7 +972,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1011,7 +979,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1024,20 +991,17 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call updateUserValidateBeforeCall(String username, User body, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); } - + // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling updateUser(Async)"); } - - okhttp3.Call localVarCall = updateUserCall(username, body, _callback); - return localVarCall; + return updateUserCall(username, body, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java index 1c8ac2dc0cc..d266db0e95a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java @@ -55,6 +55,7 @@ public class OAuthOkHttpClient implements HttpClient { response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index 2bd61d7fe8a..8cbe8f9e743 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -65,8 +65,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { .setClientSecret(clientSecret)); setFlow(flow); if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); } } } @@ -129,8 +129,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { } Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); } requestBuilder.url(oAuthRequest.getLocationUri()); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8d7756779d9..b5c3088bd4b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index b4eaa174982..56f260190fb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -41,6 +41,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b1e6978f33c..1900602cc90 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index d8011780430..28e24761d16 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 590723e883c..b48e84fbd33 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f505b4ac8c6..b880878a656 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -41,6 +41,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 84557a8dc12..47f9a4e9f33 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -41,6 +41,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index a2043e6007d..b5f03dc03b6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -40,6 +40,7 @@ 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; 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 f5664798e13..4fa7021e184 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java @@ -43,6 +43,7 @@ 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; 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 7e094261c25..7231105b33f 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 @@ -43,6 +43,7 @@ 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; @@ -184,8 +185,8 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - // ensure the json data is an array - if (!jsonObj.get("ArrayArrayNumber").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("ArrayArrayNumber") != null && !jsonObj.get("ArrayArrayNumber").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `ArrayArrayNumber` to be an array in the JSON string but got `%s`", jsonObj.get("ArrayArrayNumber").toString())); } } 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 9b1111fdd99..b1b768f2f48 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 @@ -43,6 +43,7 @@ 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; @@ -184,8 +185,8 @@ public class ArrayOfNumberOnly implements Parcelable { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - // ensure the json data is an array - if (!jsonObj.get("ArrayNumber").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("ArrayNumber") != null && !jsonObj.get("ArrayNumber").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `ArrayNumber` to be an array in the JSON string but got `%s`", jsonObj.get("ArrayNumber").toString())); } } 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 15d24122535..eb8632f2102 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 @@ -43,6 +43,7 @@ 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; @@ -264,16 +265,16 @@ public class ArrayTest implements Parcelable { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - // ensure the json data is an array - if (!jsonObj.get("array_of_string").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_of_string") != null && !jsonObj.get("array_of_string").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_of_string` to be an array in the JSON string but got `%s`", jsonObj.get("array_of_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_array_of_integer").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_array_of_integer") != null && !jsonObj.get("array_array_of_integer").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_array_of_integer` to be an array in the JSON string but got `%s`", jsonObj.get("array_array_of_integer").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_array_of_model").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_array_of_model") != null && !jsonObj.get("array_array_of_model").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_array_of_model` to be an array in the JSON string but got `%s`", jsonObj.get("array_array_of_model").toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java index 8852815c3c1..a3acc08d1e6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java @@ -41,6 +41,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 42500992c6e..47bba8c9e1f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java index af3f7f2e9cc..6c0bbe5e0b1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Capitalization.java @@ -40,6 +40,7 @@ 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; 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 076ede1bd89..4539407a705 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 @@ -42,6 +42,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java index 3cc84ae9af3..be9f44495a7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java index 1751bab19f3..97ed931c496 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Category.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java index 4a9de3cac46..d5279749f1c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ClassModel.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java index ed7e83da8e0..46807a0ec1d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Client.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java index 2d6baf6963f..742daf88144 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java @@ -41,6 +41,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java index 78709e104f9..9f2896c146f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -40,6 +40,7 @@ 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; 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 af5771461ce..af8c177e095 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 @@ -42,6 +42,7 @@ 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; @@ -312,8 +313,8 @@ public class EnumArrays implements Parcelable { if ((jsonObj.get("just_symbol") != null && !jsonObj.get("just_symbol").isJsonNull()) && !jsonObj.get("just_symbol").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `just_symbol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("just_symbol").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_enum").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_enum") != null && !jsonObj.get("array_enum").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_enum` to be an array in the JSON string but got `%s`", jsonObj.get("array_enum").toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java index 8124606cef2..68138d0844b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java @@ -41,6 +41,7 @@ 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; 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 71b55845f8d..4660dae58b3 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 @@ -43,6 +43,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java index ed3d5493509..4c4cc822ea7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/FormatTest.java @@ -45,6 +45,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index c6977ace6ea..c936f4720be 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java index 348d37b8418..3315a2744ed 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java @@ -42,6 +42,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9402576b34c..7a69f76f0f5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -45,6 +45,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java index 27b40d32d52..68796a1d54f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Model200Response.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 47538e4ef16..04ae3e94260 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java index 760aabb64b3..0fb8551018f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java index 3e9aa0ad1c7..41c3bdd1926 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java index 45ca478e7af..78460aefadb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java index 05c563c3ea6..22ee9720f6c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Name.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java index a0281d35274..9972d04072d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -41,6 +41,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java index f18f79fd9e3..7edbd5e84f7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Order.java @@ -41,6 +41,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java index 5199ecbf4ef..d21634d52d3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -41,6 +41,7 @@ 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; 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 5b88f2f5372..6c7c5a83ae1 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 @@ -46,6 +46,7 @@ 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; @@ -417,8 +418,10 @@ public class Pet implements Parcelable { if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - // ensure the json data is an array - if ((jsonObj.get("photoUrls") != null && !jsonObj.get("photoUrls").isJsonNull()) && !jsonObj.get("photoUrls").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("photoUrls") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("photoUrls").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj.get("photoUrls").toString())); } if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e326374f695..fdeeeacbed7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java index 17e08f6372b..66591f6388d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -40,6 +40,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java index 520daa2fdeb..3d66e85d816 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Tag.java @@ -40,6 +40,7 @@ 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; 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 b20530e83d1..3a0d079885f 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 @@ -43,6 +43,7 @@ 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; @@ -324,8 +325,10 @@ public class TypeHolderDefault implements Parcelable { if (!jsonObj.get("string_item").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `string_item` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_item").toString())); } - // ensure the json data is an array - if ((jsonObj.get("array_item") != null && !jsonObj.get("array_item").isJsonNull()) && !jsonObj.get("array_item").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("array_item") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("array_item").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_item` to be an array in the JSON string but got `%s`", jsonObj.get("array_item").toString())); } } 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 57c2e37c43f..6d7f0b131ce 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 @@ -43,6 +43,7 @@ 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; @@ -357,8 +358,10 @@ public class TypeHolderExample implements Parcelable { if (!jsonObj.get("string_item").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `string_item` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_item").toString())); } - // ensure the json data is an array - if ((jsonObj.get("array_item") != null && !jsonObj.get("array_item").isJsonNull()) && !jsonObj.get("array_item").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("array_item") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("array_item").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_item` to be an array in the JSON string but got `%s`", jsonObj.get("array_item").toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java index 41a3c81b01a..c91bcc06a31 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/User.java @@ -40,6 +40,7 @@ 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; 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 218d9ac3247..628a942c261 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 @@ -43,6 +43,7 @@ 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; @@ -1147,52 +1148,52 @@ public class XmlItem implements Parcelable { if ((jsonObj.get("attribute_string") != null && !jsonObj.get("attribute_string").isJsonNull()) && !jsonObj.get("attribute_string").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `attribute_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attribute_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("wrapped_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("wrapped_array") != null && !jsonObj.get("wrapped_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("wrapped_array").toString())); } if ((jsonObj.get("name_string") != null && !jsonObj.get("name_string").isJsonNull()) && !jsonObj.get("name_string").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("name_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("name_array") != null && !jsonObj.get("name_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `name_array` to be an array in the JSON string but got `%s`", jsonObj.get("name_array").toString())); } - // ensure the json data is an array - if (!jsonObj.get("name_wrapped_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("name_wrapped_array") != null && !jsonObj.get("name_wrapped_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `name_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("name_wrapped_array").toString())); } if ((jsonObj.get("prefix_string") != null && !jsonObj.get("prefix_string").isJsonNull()) && !jsonObj.get("prefix_string").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("prefix_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("prefix_array") != null && !jsonObj.get("prefix_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_array").toString())); } - // ensure the json data is an array - if (!jsonObj.get("prefix_wrapped_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("prefix_wrapped_array") != null && !jsonObj.get("prefix_wrapped_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_wrapped_array").toString())); } if ((jsonObj.get("namespace_string") != null && !jsonObj.get("namespace_string").isJsonNull()) && !jsonObj.get("namespace_string").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("namespace_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("namespace_array") != null && !jsonObj.get("namespace_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_array` to be an array in the JSON string but got `%s`", jsonObj.get("namespace_array").toString())); } - // ensure the json data is an array - if (!jsonObj.get("namespace_wrapped_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("namespace_wrapped_array") != null && !jsonObj.get("namespace_wrapped_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `namespace_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("namespace_wrapped_array").toString())); } if ((jsonObj.get("prefix_ns_string") != null && !jsonObj.get("prefix_ns_string").isJsonNull()) && !jsonObj.get("prefix_ns_string").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_string` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix_ns_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("prefix_ns_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("prefix_ns_array") != null && !jsonObj.get("prefix_ns_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_ns_array").toString())); } - // ensure the json data is an array - if (!jsonObj.get("prefix_ns_wrapped_array").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("prefix_ns_wrapped_array") != null && !jsonObj.get("prefix_ns_wrapped_array").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `prefix_ns_wrapped_array` to be an array in the JSON string but got `%s`", jsonObj.get("prefix_ns_wrapped_array").toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index 2015aa8f41e..17f1178d951 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -13,7 +13,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -65,7 +65,7 @@ if(hasProperty('target') && target == 'android') { task.from variant.javaCompile.destinationDir task.destinationDir = project.file("${project.buildDir}/outputs/jar") task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + artifacts.add('archives', task) } } @@ -106,21 +106,21 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.6.5' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.3' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3' - implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.8.5' implementation 'javax.ws.rs:jsr311-api:1.1.1' implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' - implementation 'org.openapitools:jackson-databind-nullable:0.2.3' - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.4' + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index 89ce30b4549..9abac35cf05 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -10,19 +10,20 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.6.5", - "com.squareup.okhttp3" % "okhttp" % "4.9.3", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.3", - "com.google.code.gson" % "gson" % "2.9.0", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", "org.apache.commons" % "commons-lang3" % "3.12.0", "javax.ws.rs" % "jsr311-api" % "1.1.1", "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" ) ) diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index f838ecd5b60..5fe59defbf3 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.1.0 enforce-maven @@ -93,6 +93,7 @@ maven-dependency-plugin + 3.3.0 package @@ -109,7 +110,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -123,7 +124,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -154,7 +155,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.2 + 3.4.1 attach-javadocs @@ -177,7 +178,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.2.1 attach-sources @@ -291,7 +292,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.client - 1.0.1 + 1.0.2 org.apache.commons @@ -345,17 +346,17 @@ ${java.version} 1.8.5 1.6.5 - 4.9.3 - 2.9.0 + 4.10.0 + 2.9.1 3.12.0 - 0.2.3 + 0.2.4 1.3.5 - 5.8.2 - 1.6.2 + 5.9.1 + 1.9.1 3.12.4 2.1.1 1.1.1 UTF-8 - 2.21.0 + 2.27.2 diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index 0fcd95584a3..8333bceafe2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -366,7 +366,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); + JSON.setDateFormat(dateFormat); return this; } @@ -377,7 +377,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); + JSON.setSqlDateFormat(dateFormat); return this; } @@ -388,7 +388,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); + JSON.setOffsetDateTimeFormat(dateFormat); return this; } @@ -399,7 +399,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -410,7 +410,7 @@ public class ApiClient { * @return a {@link org.openapitools.client.ApiClient} object */ public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + JSON.setLenientOnJson(lenientOnJson); return this; } @@ -704,7 +704,7 @@ public class ApiClient { return ""; } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -712,7 +712,7 @@ public class ApiClient { if (b.length() > 0) { b.append(","); } - b.append(String.valueOf(o)); + b.append(o); } return b.toString(); } else { @@ -963,7 +963,7 @@ public class ApiClient { contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; @@ -997,13 +997,13 @@ public class ApiClient { } else if (isJsonMime(contentType)) { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } return RequestBody.create(content, MediaType.parse(contentType)); } else if (obj instanceof String) { - return RequestBody.create(MediaType.parse(contentType), (String) obj); + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } @@ -1476,7 +1476,7 @@ public class ApiClient { } else { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } @@ -1554,7 +1554,7 @@ public class ApiClient { KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); + String certificateAlias = "ca" + (index++); caKeyStore.setCertificateEntry(certificateAlias, certificate); } trustManagerFactory.init(caKeyStore); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index f38e4499a61..dd20623d4b2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -132,15 +132,12 @@ public class AnotherFakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'client' is set if (client == null) { throw new ApiException("Missing the required parameter 'client' when calling call123testSpecialTags(Async)"); } - - okhttp3.Call localVarCall = call123testSpecialTagsCall(client, _callback); - return localVarCall; + return call123testSpecialTagsCall(client, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java index c7f201d8b65..ee3f7324613 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -118,7 +118,6 @@ public class DefaultApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -131,10 +130,7 @@ public class DefaultApi { @SuppressWarnings("rawtypes") private okhttp3.Call fooGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fooGetCall(_callback); - return localVarCall; + return fooGetCall(_callback); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 0452a3a613d..99ad929095d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -127,7 +127,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -140,10 +139,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeHealthGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeHealthGetCall(_callback); - return localVarCall; + return fakeHealthGetCall(_callback); } @@ -258,10 +254,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterBooleanSerializeCall(body, _callback); - return localVarCall; + return fakeOuterBooleanSerializeCall(body, _callback); } @@ -379,10 +372,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterCompositeSerializeCall(outerComposite, _callback); - return localVarCall; + return fakeOuterCompositeSerializeCall(outerComposite, _callback); } @@ -500,10 +490,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterNumberSerializeCall(body, _callback); - return localVarCall; + return fakeOuterNumberSerializeCall(body, _callback); } @@ -621,10 +608,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call fakeOuterStringSerializeValidateBeforeCall(String body, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = fakeOuterStringSerializeCall(body, _callback); - return localVarCall; + return fakeOuterStringSerializeCall(body, _callback); } @@ -728,7 +712,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -741,10 +724,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call getArrayOfEnumsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getArrayOfEnumsCall(_callback); - return localVarCall; + return getArrayOfEnumsCall(_callback); } @@ -838,7 +818,6 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -859,15 +838,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) { throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)"); } - - okhttp3.Call localVarCall = testBodyWithFileSchemaCall(fileSchemaTestClass, _callback); - return localVarCall; + return testBodyWithFileSchemaCall(fileSchemaTestClass, _callback); } @@ -965,7 +941,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -986,20 +961,17 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testBodyWithQueryParamsValidateBeforeCall(String query, User user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'query' is set if (query == null) { throw new ApiException("Missing the required parameter 'query' when calling testBodyWithQueryParams(Async)"); } - + // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling testBodyWithQueryParams(Async)"); } - - okhttp3.Call localVarCall = testBodyWithQueryParamsCall(query, user, _callback); - return localVarCall; + return testBodyWithQueryParamsCall(query, user, _callback); } @@ -1116,15 +1088,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testClientModelValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'client' is set if (client == null) { throw new ApiException("Missing the required parameter 'client' when calling testClientModel(Async)"); } - - okhttp3.Call localVarCall = testClientModelCall(client, _callback); - return localVarCall; + return testClientModelCall(client, _callback); } @@ -1291,7 +1260,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1312,30 +1280,27 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'number' is set if (number == null) { throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)"); } - + // verify the required parameter '_double' is set if (_double == null) { throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)"); } - + // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) { throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)"); } - + // verify the required parameter '_byte' is set if (_byte == null) { throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)"); } - - okhttp3.Call localVarCall = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback); - return localVarCall; + return testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback); } @@ -1510,7 +1475,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1531,10 +1495,7 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testEnumParametersValidateBeforeCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback); - return localVarCall; + return testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback); } @@ -1663,7 +1624,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1671,7 +1631,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1684,25 +1643,22 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testGroupParametersValidateBeforeCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { throw new ApiException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters(Async)"); } - + // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup == null) { throw new ApiException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters(Async)"); } - + // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group == null) { throw new ApiException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters(Async)"); } - - okhttp3.Call localVarCall = testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); - return localVarCall; + return testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); } @@ -1875,7 +1831,6 @@ public class FakeApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1896,15 +1851,12 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testInlineAdditionalPropertiesValidateBeforeCall(Map requestBody, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties(Async)"); } - - okhttp3.Call localVarCall = testInlineAdditionalPropertiesCall(requestBody, _callback); - return localVarCall; + return testInlineAdditionalPropertiesCall(requestBody, _callback); } @@ -2006,7 +1958,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -2027,20 +1978,17 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testJsonFormDataValidateBeforeCall(String param, String param2, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'param' is set if (param == null) { throw new ApiException("Missing the required parameter 'param' when calling testJsonFormData(Async)"); } - + // verify the required parameter 'param2' is set if (param2 == null) { throw new ApiException("Missing the required parameter 'param2' when calling testJsonFormData(Async)"); } - - okhttp3.Call localVarCall = testJsonFormDataCall(param, param2, _callback); - return localVarCall; + return testJsonFormDataCall(param, param2, _callback); } @@ -2160,7 +2108,6 @@ public class FakeApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -2168,7 +2115,6 @@ public class FakeApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -2181,35 +2127,32 @@ public class FakeApi { @SuppressWarnings("rawtypes") private okhttp3.Call testQueryParameterCollectionFormatValidateBeforeCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pipe' is set if (pipe == null) { throw new ApiException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'ioutil' is set if (ioutil == null) { throw new ApiException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'http' is set if (http == null) { throw new ApiException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'url' is set if (url == null) { throw new ApiException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat(Async)"); } - + // verify the required parameter 'context' is set if (context == null) { throw new ApiException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat(Async)"); } - - okhttp3.Call localVarCall = testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); - return localVarCall; + return testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 0437e89e5c4..bf49324d416 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -132,15 +132,12 @@ public class FakeClassnameTags123Api { @SuppressWarnings("rawtypes") private okhttp3.Call testClassnameValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'client' is set if (client == null) { throw new ApiException("Missing the required parameter 'client' when calling testClassname(Async)"); } - - okhttp3.Call localVarCall = testClassnameCall(client, _callback); - return localVarCall; + return testClassnameCall(client, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java index 45e183a465e..5b6191cd4dc 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java @@ -113,7 +113,6 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -121,7 +120,8 @@ public class PetApi { } final String[] localVarContentTypes = { - "application/json", "application/xml" + "application/json", + "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -134,15 +134,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call addPetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pet' is set if (pet == null) { throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)"); } - - okhttp3.Call localVarCall = addPetCall(pet, _callback); - return localVarCall; + return addPetCall(pet, _callback); } @@ -228,7 +225,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -241,7 +238,6 @@ public class PetApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -249,7 +245,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -262,15 +257,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)"); } - - okhttp3.Call localVarCall = deletePetCall(petId, apiKey, _callback); - return localVarCall; + return deletePetCall(petId, apiKey, _callback); } @@ -371,7 +363,8 @@ public class PetApi { } final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -379,7 +372,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -392,15 +384,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call findPetsByStatusValidateBeforeCall(List status, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'status' is set if (status == null) { throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)"); } - - okhttp3.Call localVarCall = findPetsByStatusCall(status, _callback); - return localVarCall; + return findPetsByStatusCall(status, _callback); } @@ -507,7 +496,8 @@ public class PetApi { } final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -515,7 +505,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -529,15 +518,12 @@ public class PetApi { @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'tags' is set if (tags == null) { throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)"); } - - okhttp3.Call localVarCall = findPetsByTagsCall(tags, _callback); - return localVarCall; + return findPetsByTagsCall(tags, _callback); } @@ -637,7 +623,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -646,7 +632,8 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -654,7 +641,6 @@ public class PetApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -667,15 +653,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call getPetByIdValidateBeforeCall(Long petId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)"); } - - okhttp3.Call localVarCall = getPetByIdCall(petId, _callback); - return localVarCall; + return getPetByIdCall(petId, _callback); } @@ -780,7 +763,6 @@ public class PetApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -788,7 +770,8 @@ public class PetApi { } final String[] localVarContentTypes = { - "application/json", "application/xml" + "application/json", + "application/xml" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -801,15 +784,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call updatePetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pet' is set if (pet == null) { throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)"); } - - okhttp3.Call localVarCall = updatePetCall(pet, _callback); - return localVarCall; + return updatePetCall(pet, _callback); } @@ -902,7 +882,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -919,7 +899,6 @@ public class PetApi { } final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -940,15 +919,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)"); } - - okhttp3.Call localVarCall = updatePetWithFormCall(petId, name, status, _callback); - return localVarCall; + return updatePetWithFormCall(petId, name, status, _callback); } @@ -1041,7 +1017,7 @@ public class PetApi { // create path and map variables String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1079,15 +1055,12 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)"); } - - okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, _file, _callback); - return localVarCall; + return uploadFileCall(petId, additionalMetadata, _file, _callback); } @@ -1184,7 +1157,7 @@ public class PetApi { // create path and map variables String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" - .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1222,20 +1195,17 @@ public class PetApi { @SuppressWarnings("rawtypes") private okhttp3.Call uploadFileWithRequiredFileValidateBeforeCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile(Async)"); } - + // verify the required parameter 'requiredFile' is set if (requiredFile == null) { throw new ApiException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile(Async)"); } - - okhttp3.Call localVarCall = uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, _callback); - return localVarCall; + return uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java index 165a3df932a..6069ecfb8c5 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java @@ -104,7 +104,7 @@ public class StoreApi { // create path and map variables String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); + .replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -113,7 +113,6 @@ public class StoreApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -121,7 +120,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -134,15 +132,12 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call deleteOrderValidateBeforeCall(String orderId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)"); } - - okhttp3.Call localVarCall = deleteOrderCall(orderId, _callback); - return localVarCall; + return deleteOrderCall(orderId, _callback); } @@ -245,7 +240,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -258,10 +252,7 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call getInventoryValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getInventoryCall(_callback); - return localVarCall; + return getInventoryCall(_callback); } @@ -349,7 +340,7 @@ public class StoreApi { // create path and map variables String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); + .replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -358,7 +349,8 @@ public class StoreApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -366,7 +358,6 @@ public class StoreApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -379,15 +370,12 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call getOrderByIdValidateBeforeCall(Long orderId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)"); } - - okhttp3.Call localVarCall = getOrderByIdCall(orderId, _callback); - return localVarCall; + return getOrderByIdCall(orderId, _callback); } @@ -491,7 +479,8 @@ public class StoreApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -512,15 +501,12 @@ public class StoreApi { @SuppressWarnings("rawtypes") private okhttp3.Call placeOrderValidateBeforeCall(Order order, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'order' is set if (order == null) { throw new ApiException("Missing the required parameter 'order' when calling placeOrder(Async)"); } - - okhttp3.Call localVarCall = placeOrderCall(order, _callback); - return localVarCall; + return placeOrderCall(order, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java index a4e78ed0b43..3398667afb1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java @@ -112,7 +112,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -133,15 +132,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call createUserValidateBeforeCall(User user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); } - - okhttp3.Call localVarCall = createUserCall(user, _callback); - return localVarCall; + return createUserCall(user, _callback); } @@ -234,7 +230,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -255,15 +250,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling createUsersWithArrayInput(Async)"); } - - okhttp3.Call localVarCall = createUsersWithArrayInputCall(user, _callback); - return localVarCall; + return createUsersWithArrayInputCall(user, _callback); } @@ -356,7 +348,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -377,15 +368,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call createUsersWithListInputValidateBeforeCall(List user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling createUsersWithListInput(Async)"); } - - okhttp3.Call localVarCall = createUsersWithListInputCall(user, _callback); - return localVarCall; + return createUsersWithListInputCall(user, _callback); } @@ -471,7 +459,7 @@ public class UserApi { // create path and map variables String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -480,7 +468,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -488,7 +475,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -501,15 +487,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call deleteUserValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)"); } - - okhttp3.Call localVarCall = deleteUserCall(username, _callback); - return localVarCall; + return deleteUserCall(username, _callback); } @@ -599,7 +582,7 @@ public class UserApi { // create path and map variables String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -608,7 +591,8 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -616,7 +600,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -629,15 +612,12 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call getUserByNameValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)"); } - - okhttp3.Call localVarCall = getUserByNameCall(username, _callback); - return localVarCall; + return getUserByNameCall(username, _callback); } @@ -750,7 +730,8 @@ public class UserApi { } final String[] localVarAccepts = { - "application/xml", "application/json" + "application/xml", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -758,7 +739,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -771,20 +751,17 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call loginUserValidateBeforeCall(String username, String password, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)"); } - + // verify the required parameter 'password' is set if (password == null) { throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)"); } - - okhttp3.Call localVarCall = loginUserCall(username, password, _callback); - return localVarCall; + return loginUserCall(username, password, _callback); } @@ -886,7 +863,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -894,7 +870,6 @@ public class UserApi { } final String[] localVarContentTypes = { - }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -907,10 +882,7 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call logoutUserValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = logoutUserCall(_callback); - return localVarCall; + return logoutUserCall(_callback); } @@ -994,7 +966,7 @@ public class UserApi { // create path and map variables String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1003,7 +975,6 @@ public class UserApi { Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1024,20 +995,17 @@ public class UserApi { @SuppressWarnings("rawtypes") private okhttp3.Call updateUserValidateBeforeCall(String username, User user, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); } - + // verify the required parameter 'user' is set if (user == null) { throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)"); } - - okhttp3.Call localVarCall = updateUserCall(username, user, _callback); - return localVarCall; + return updateUserCall(username, user, _callback); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java index 1c8ac2dc0cc..d266db0e95a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java @@ -55,6 +55,7 @@ public class OAuthOkHttpClient implements HttpClient { response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java index 2bd61d7fe8a..8cbe8f9e743 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -65,8 +65,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { .setClientSecret(clientSecret)); setFlow(flow); if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); } } } @@ -129,8 +129,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { } Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); } requestBuilder.url(oAuthRequest.getLocationUri()); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 927b23386e9..a3f07fb7188 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -41,6 +41,7 @@ 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; @@ -312,6 +313,10 @@ public class AdditionalPropertiesClass { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AdditionalPropertiesClass instance itself */ public AdditionalPropertiesClass putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -323,6 +328,8 @@ public class AdditionalPropertiesClass { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -330,6 +337,9 @@ public class AdditionalPropertiesClass { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -489,8 +499,10 @@ public class AdditionalPropertiesClass { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 e1d94b6362c..5ca742c7094 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 @@ -40,6 +40,7 @@ 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; @@ -118,6 +119,10 @@ public class Animal { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Animal instance itself */ public Animal putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -129,6 +134,8 @@ public class Animal { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -136,6 +143,9 @@ public class Animal { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Apple.java index 9183df38a0c..13e8cd18445 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Apple.java @@ -38,6 +38,7 @@ 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; @@ -115,6 +116,10 @@ public class Apple { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Apple instance itself */ public Apple putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -126,6 +131,8 @@ public class Apple { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -133,6 +140,9 @@ public class Apple { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -269,8 +279,10 @@ public class Apple { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AppleReq.java index dd30c95c03f..a11bbcb3d37 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AppleReq.java @@ -38,6 +38,7 @@ 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; 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 ca1cf1d3878..6633031c3bb 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 @@ -41,6 +41,7 @@ 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; @@ -99,6 +100,10 @@ public class ArrayOfArrayOfNumberOnly { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ArrayOfArrayOfNumberOnly instance itself */ public ArrayOfArrayOfNumberOnly putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -110,6 +115,8 @@ public class ArrayOfArrayOfNumberOnly { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -117,6 +124,9 @@ public class ArrayOfArrayOfNumberOnly { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -190,8 +200,8 @@ public class ArrayOfArrayOfNumberOnly { throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfArrayOfNumberOnly is not found in the empty JSON string", ArrayOfArrayOfNumberOnly.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (!jsonObj.get("ArrayArrayNumber").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("ArrayArrayNumber") != null && !jsonObj.get("ArrayArrayNumber").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `ArrayArrayNumber` to be an array in the JSON string but got `%s`", jsonObj.get("ArrayArrayNumber").toString())); } } @@ -248,8 +258,10 @@ public class ArrayOfArrayOfNumberOnly { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 267f4099282..516cdf497df 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 @@ -41,6 +41,7 @@ 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; @@ -153,6 +154,10 @@ public class ArrayOfInlineAllOf { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ArrayOfInlineAllOf instance itself */ public ArrayOfInlineAllOf putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -164,6 +169,8 @@ public class ArrayOfInlineAllOf { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -171,6 +178,9 @@ public class ArrayOfInlineAllOf { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -329,8 +339,10 @@ public class ArrayOfInlineAllOf { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInner.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInner.java index 343155380bc..10e7f8f56fb 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInner.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInner.java @@ -38,6 +38,7 @@ 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; @@ -115,6 +116,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ArrayOfInlineAllOfArrayAllofDogPropertyInner instance itself */ public ArrayOfInlineAllOfArrayAllofDogPropertyInner putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -126,6 +131,8 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -133,6 +140,9 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -269,8 +279,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.java index c0382289187..10399e91696 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf instance itself */ public ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -236,8 +246,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1.java index ca9607ca9ce..35ca78826d4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 instance itself */ public ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -236,8 +246,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.java deleted file mode 100644 index b71641713fd..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -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.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf { - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; - - public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf() { - } - - public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf color(String color) { - - this.color = color; - return this; - } - - /** - * Get color - * @return color - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getColor() { - return color; - } - - - public void setColor(String color) { - this.color = color; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf = (ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf) o; - return Objects.equals(this.color, arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.color)&& - Objects.equals(this.additionalProperties, arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(color, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf {\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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("color"); - - // 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 ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf is not found in the empty JSON string", ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.openapiRequiredFields.toString())); - } - } - if (jsonObj.get("color") != null && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf - * @throws IOException if the JSON string is invalid with respect to ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf - */ - public static ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.class); - } - - /** - * Convert an instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.java deleted file mode 100644 index 8e156c9d119..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -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.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 { - public static final String SERIALIZED_NAME_COLOR = "color"; - @SerializedName(SERIALIZED_NAME_COLOR) - private String color; - - public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1() { - } - - public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 color(String color) { - - this.color = color; - return this; - } - - /** - * Get color - * @return color - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getColor() { - return color; - } - - - public void setColor(String color) { - this.color = color; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 = (ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1) o; - return Objects.equals(this.color, arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.color)&& - Objects.equals(this.additionalProperties, arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(color, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 {\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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("color"); - - // 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 ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 is not found in the empty JSON string", ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.openapiRequiredFields.toString())); - } - } - if (jsonObj.get("color") != null && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 - * @throws IOException if the JSON string is invalid with respect to ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 - */ - public static ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.class); - } - - /** - * Convert an instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - 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 7bdd9ad6365..650d52d8912 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 @@ -41,6 +41,7 @@ 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; @@ -99,6 +100,10 @@ public class ArrayOfNumberOnly { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ArrayOfNumberOnly instance itself */ public ArrayOfNumberOnly putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -110,6 +115,8 @@ public class ArrayOfNumberOnly { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -117,6 +124,9 @@ public class ArrayOfNumberOnly { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -190,8 +200,8 @@ public class ArrayOfNumberOnly { throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfNumberOnly is not found in the empty JSON string", ArrayOfNumberOnly.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (!jsonObj.get("ArrayNumber").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("ArrayNumber") != null && !jsonObj.get("ArrayNumber").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `ArrayNumber` to be an array in the JSON string but got `%s`", jsonObj.get("ArrayNumber").toString())); } } @@ -248,8 +258,10 @@ public class ArrayOfNumberOnly { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 fa4e62ac1e8..13455dd6478 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 @@ -41,6 +41,7 @@ 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; @@ -169,6 +170,10 @@ public class ArrayTest { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ArrayTest instance itself */ public ArrayTest putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -180,6 +185,8 @@ public class ArrayTest { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -187,6 +194,9 @@ public class ArrayTest { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -266,16 +276,16 @@ public class ArrayTest { throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTest is not found in the empty JSON string", ArrayTest.openapiRequiredFields.toString())); } } - // ensure the json data is an array - if (!jsonObj.get("array_of_string").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_of_string") != null && !jsonObj.get("array_of_string").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_of_string` to be an array in the JSON string but got `%s`", jsonObj.get("array_of_string").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_array_of_integer").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_array_of_integer") != null && !jsonObj.get("array_array_of_integer").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_array_of_integer` to be an array in the JSON string but got `%s`", jsonObj.get("array_array_of_integer").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_array_of_model").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_array_of_model") != null && !jsonObj.get("array_array_of_model").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_array_of_model` to be an array in the JSON string but got `%s`", jsonObj.get("array_array_of_model").toString())); } } @@ -332,8 +342,10 @@ public class ArrayTest { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Banana.java index 409f56dc5fb..cc63b0f716d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Banana.java @@ -39,6 +39,7 @@ 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; @@ -89,6 +90,10 @@ public class Banana { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Banana instance itself */ public Banana putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -100,6 +105,8 @@ public class Banana { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -107,6 +114,9 @@ public class Banana { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -234,8 +244,10 @@ public class Banana { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BananaReq.java index 877f598954a..c7dbded16eb 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BananaReq.java @@ -39,6 +39,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BasquePig.java index ed5f880e3b8..44826333ba6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BasquePig.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class BasquePig { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BasquePig instance itself */ public BasquePig putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class BasquePig { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class BasquePig { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -244,8 +254,10 @@ public class BasquePig { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java index a7b48934c34..ef377c09c36 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -38,6 +38,7 @@ 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; @@ -223,6 +224,10 @@ public class Capitalization { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Capitalization instance itself */ public Capitalization putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -234,6 +239,8 @@ public class Capitalization { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -241,6 +248,9 @@ public class Capitalization { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -401,8 +411,10 @@ public class Capitalization { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java index a517389ddc1..9145aa14000 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java @@ -39,6 +39,7 @@ 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; @@ -90,6 +91,10 @@ public class Cat extends Animal { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Cat instance itself */ public Cat putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -101,6 +106,8 @@ public class Cat extends Animal { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -108,6 +115,9 @@ public class Cat extends Animal { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -247,8 +257,10 @@ public class Cat extends Animal { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java index 09ce3c2ef7c..9ff89c24e68 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class CatAllOf { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CatAllOf instance itself */ public CatAllOf putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class CatAllOf { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class CatAllOf { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -233,8 +243,10 @@ public class CatAllOf { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java index 77d61772075..7a127d606ac 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Category.java @@ -38,6 +38,7 @@ 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; @@ -115,6 +116,10 @@ public class Category { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Category instance itself */ public Category putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -126,6 +131,8 @@ public class Category { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -133,6 +140,9 @@ public class Category { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -274,8 +284,10 @@ public class Category { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java index 0f8b166129d..7c78ec4f349 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -38,6 +38,7 @@ 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; @@ -89,6 +90,10 @@ public class ClassModel { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ClassModel instance itself */ public ClassModel putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -100,6 +105,8 @@ public class ClassModel { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -107,6 +114,9 @@ public class ClassModel { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -237,8 +247,10 @@ public class ClassModel { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java index a04df3e85f8..15be7de77ac 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Client.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class Client { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Client instance itself */ public Client putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class Client { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class Client { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -236,8 +246,10 @@ public class Client { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index a3b2b1cf257..8020a1c0cce 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -38,6 +38,7 @@ 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; @@ -115,6 +116,10 @@ public class ComplexQuadrilateral { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ComplexQuadrilateral instance itself */ public ComplexQuadrilateral putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -126,6 +131,8 @@ public class ComplexQuadrilateral { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -133,6 +140,9 @@ public class ComplexQuadrilateral { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -278,8 +288,10 @@ public class ComplexQuadrilateral { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DanishPig.java index 9ec2c05fc64..a93b861f885 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DanishPig.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class DanishPig { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DanishPig instance itself */ public DanishPig putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class DanishPig { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class DanishPig { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -244,8 +254,10 @@ public class DanishPig { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DeprecatedObject.java index ef76ed5f9ca..6434f62dd59 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -38,6 +38,7 @@ 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; @@ -90,6 +91,10 @@ public class DeprecatedObject { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeprecatedObject instance itself */ public DeprecatedObject putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -101,6 +106,8 @@ public class DeprecatedObject { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -108,6 +115,9 @@ public class DeprecatedObject { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -238,8 +248,10 @@ public class DeprecatedObject { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java index 208d3c7494d..03fec9e0531 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java @@ -39,6 +39,7 @@ 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; @@ -90,6 +91,10 @@ public class Dog extends Animal { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Dog instance itself */ public Dog putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -101,6 +106,8 @@ public class Dog extends Animal { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -108,6 +115,9 @@ public class Dog extends Animal { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -247,8 +257,10 @@ public class Dog extends Animal { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java index b38a433b5ed..4f30a816582 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class DogAllOf { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DogAllOf instance itself */ public DogAllOf putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class DogAllOf { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class DogAllOf { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -236,8 +246,10 @@ public class DogAllOf { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 917defa10c0..c37ee9595c5 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 @@ -45,6 +45,7 @@ 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; 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 bed41536238..217c5da5cec 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 @@ -40,6 +40,7 @@ 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; @@ -219,6 +220,10 @@ public class EnumArrays { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EnumArrays instance itself */ public EnumArrays putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -230,6 +235,8 @@ public class EnumArrays { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -237,6 +244,9 @@ public class EnumArrays { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -316,8 +326,8 @@ public class EnumArrays { if ((jsonObj.get("just_symbol") != null && !jsonObj.get("just_symbol").isJsonNull()) && !jsonObj.get("just_symbol").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `just_symbol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("just_symbol").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_enum").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_enum") != null && !jsonObj.get("array_enum").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_enum` to be an array in the JSON string but got `%s`", jsonObj.get("array_enum").toString())); } } @@ -374,8 +384,10 @@ public class EnumArrays { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumStringDiscriminator.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumStringDiscriminator.java index 1b832638774..41db1a90f07 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumStringDiscriminator.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumStringDiscriminator.java @@ -38,6 +38,7 @@ 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; @@ -136,6 +137,10 @@ public class EnumStringDiscriminator { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EnumStringDiscriminator instance itself */ public EnumStringDiscriminator putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -147,6 +152,8 @@ public class EnumStringDiscriminator { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -154,6 +161,9 @@ public class EnumStringDiscriminator { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -289,8 +299,10 @@ public class EnumStringDiscriminator { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java index 58a4f1dfa6b..758616c598d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -43,6 +43,7 @@ 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; @@ -548,6 +549,10 @@ public class EnumTest { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EnumTest instance itself */ public EnumTest putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -559,6 +564,8 @@ public class EnumTest { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -566,6 +573,9 @@ public class EnumTest { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -742,8 +752,10 @@ public class EnumTest { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 2812fa4d5a9..6e28cc9617f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -38,6 +38,7 @@ 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; @@ -115,6 +116,10 @@ public class EquilateralTriangle { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EquilateralTriangle instance itself */ public EquilateralTriangle putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -126,6 +131,8 @@ public class EquilateralTriangle { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -133,6 +140,9 @@ public class EquilateralTriangle { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -278,8 +288,10 @@ public class EquilateralTriangle { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 4acf99ff463..cec79884352 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 @@ -41,6 +41,7 @@ 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; @@ -126,6 +127,10 @@ public class FileSchemaTestClass { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FileSchemaTestClass instance itself */ public FileSchemaTestClass putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -137,6 +142,8 @@ public class FileSchemaTestClass { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -144,6 +151,9 @@ public class FileSchemaTestClass { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -292,8 +302,10 @@ public class FileSchemaTestClass { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Foo.java index e45183c138d..edeaa16b2e6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Foo.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class Foo { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Foo instance itself */ public Foo putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class Foo { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class Foo { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -236,8 +246,10 @@ public class Foo { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 69cf96e7971..2ee8ff77f74 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -39,6 +39,7 @@ 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; @@ -89,6 +90,10 @@ public class FooGetDefaultResponse { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FooGetDefaultResponse instance itself */ public FooGetDefaultResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -100,6 +105,8 @@ public class FooGetDefaultResponse { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -107,6 +114,9 @@ public class FooGetDefaultResponse { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -238,8 +248,10 @@ public class FooGetDefaultResponse { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java index 0863d0572ca..66a93281aae 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -43,6 +43,7 @@ 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; @@ -535,6 +536,10 @@ public class FormatTest { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FormatTest instance itself */ public FormatTest putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -546,6 +551,8 @@ public class FormatTest { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -553,6 +560,9 @@ public class FormatTest { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -757,8 +767,10 @@ public class FormatTest { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 a5876f2aa31..c1b38b567e0 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 @@ -39,6 +39,7 @@ 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; @@ -90,6 +91,10 @@ public class GrandparentAnimal { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GrandparentAnimal instance itself */ public GrandparentAnimal putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -101,6 +106,8 @@ public class GrandparentAnimal { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -108,6 +115,9 @@ public class GrandparentAnimal { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 0fe00c40c3c..ef0f3b865c4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -38,6 +38,7 @@ 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; @@ -107,6 +108,10 @@ public class HasOnlyReadOnly { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the HasOnlyReadOnly instance itself */ public HasOnlyReadOnly putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -118,6 +123,8 @@ public class HasOnlyReadOnly { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -125,6 +132,9 @@ public class HasOnlyReadOnly { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -261,8 +271,10 @@ public class HasOnlyReadOnly { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 75f3d35db21..7272eda8650 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -39,6 +39,7 @@ 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; @@ -90,6 +91,10 @@ public class HealthCheckResult { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the HealthCheckResult instance itself */ public HealthCheckResult putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -101,6 +106,8 @@ public class HealthCheckResult { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -108,6 +115,9 @@ public class HealthCheckResult { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -249,8 +259,10 @@ public class HealthCheckResult { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/InlineResponseDefault.java deleted file mode 100644 index 1bb1be954d4..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/InlineResponseDefault.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.openapitools.client.model.Foo; - -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.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * InlineResponseDefault - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class InlineResponseDefault { - public static final String SERIALIZED_NAME_STRING = "string"; - @SerializedName(SERIALIZED_NAME_STRING) - private Foo string; - - public InlineResponseDefault() { - } - - public InlineResponseDefault string(Foo string) { - - this.string = string; - return this; - } - - /** - * Get string - * @return string - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public Foo getString() { - return string; - } - - - public void setString(Foo string) { - this.string = string; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - public InlineResponseDefault putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InlineResponseDefault inlineResponseDefault = (InlineResponseDefault) o; - return Objects.equals(this.string, inlineResponseDefault.string)&& - Objects.equals(this.additionalProperties, inlineResponseDefault.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(string, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InlineResponseDefault {\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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("string"); - - // 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 InlineResponseDefault - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (InlineResponseDefault.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in InlineResponseDefault is not found in the empty JSON string", InlineResponseDefault.openapiRequiredFields.toString())); - } - } - // validate the optional field `string` - if (jsonObj.getAsJsonObject("string") != null) { - Foo.validateJsonObject(jsonObj.getAsJsonObject("string")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InlineResponseDefault.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InlineResponseDefault' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(InlineResponseDefault.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, InlineResponseDefault value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - obj.remove("additionalProperties"); - // serialize additonal properties - if (value.getAdditionalProperties() != null) { - for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { - if (entry.getValue() instanceof String) - obj.addProperty(entry.getKey(), (String) entry.getValue()); - else if (entry.getValue() instanceof Number) - obj.addProperty(entry.getKey(), (Number) entry.getValue()); - else if (entry.getValue() instanceof Boolean) - obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); - else if (entry.getValue() instanceof Character) - obj.addProperty(entry.getKey(), (Character) entry.getValue()); - else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); - } - } - } - elementAdapter.write(out, obj); - } - - @Override - public InlineResponseDefault read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - // store additional fields in the deserialized instance - InlineResponseDefault instance = thisAdapter.fromJsonTree(jsonObj); - for (Map.Entry entry : jsonObj.entrySet()) { - if (!openapiFields.contains(entry.getKey())) { - if (entry.getValue().isJsonPrimitive()) { // primitive type - if (entry.getValue().getAsJsonPrimitive().isString()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); - else if (entry.getValue().getAsJsonPrimitive().isNumber()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); - else if (entry.getValue().getAsJsonPrimitive().isBoolean()) - instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); - else - throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); - } - } - } - return instance; - } - - }.nullSafe(); - } - } - - /** - * Create an instance of InlineResponseDefault given an JSON string - * - * @param jsonString JSON string - * @return An instance of InlineResponseDefault - * @throws IOException if the JSON string is invalid with respect to InlineResponseDefault - */ - public static InlineResponseDefault fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InlineResponseDefault.class); - } - - /** - * Convert an instance of InlineResponseDefault to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index d900a2689ca..2e3d775deec 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java index 8c4ff43c33b..5c7347833be 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java @@ -40,6 +40,7 @@ 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; @@ -250,6 +251,10 @@ public class MapTest { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MapTest instance itself */ public MapTest putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -261,6 +266,8 @@ public class MapTest { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -268,6 +275,9 @@ public class MapTest { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -404,8 +414,10 @@ public class MapTest { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 31c906e162c..5af8c69660a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -43,6 +43,7 @@ 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; @@ -155,6 +156,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MixedPropertiesAndAdditionalPropertiesClass instance itself */ public MixedPropertiesAndAdditionalPropertiesClass putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -166,6 +171,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -173,6 +180,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -309,8 +319,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java index 7ada25c4a32..7a236e7d93c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -38,6 +38,7 @@ 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; @@ -116,6 +117,10 @@ public class Model200Response { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Model200Response instance itself */ public Model200Response putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -127,6 +132,8 @@ public class Model200Response { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -134,6 +141,9 @@ public class Model200Response { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -267,8 +277,10 @@ public class Model200Response { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index fd093ddf003..dc1b56c9d29 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -38,6 +38,7 @@ 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; @@ -142,6 +143,10 @@ public class ModelApiResponse { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ModelApiResponse instance itself */ public ModelApiResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -153,6 +158,8 @@ public class ModelApiResponse { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -160,6 +167,9 @@ public class ModelApiResponse { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -299,8 +309,10 @@ public class ModelApiResponse { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java index 5dda8fc3e20..bffda975917 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -38,6 +38,7 @@ 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; @@ -89,6 +90,10 @@ public class ModelFile { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ModelFile instance itself */ public ModelFile putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -100,6 +105,8 @@ public class ModelFile { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -107,6 +114,9 @@ public class ModelFile { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -237,8 +247,10 @@ public class ModelFile { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java index 764fc3b52e2..fb09ed3ff7c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class ModelList { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ModelList instance itself */ public ModelList putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class ModelList { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class ModelList { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -236,8 +246,10 @@ public class ModelList { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java index ba7d286b5e8..93c6237225a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,7 @@ 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; @@ -89,6 +90,10 @@ public class ModelReturn { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ModelReturn instance itself */ public ModelReturn putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -100,6 +105,8 @@ public class ModelReturn { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -107,6 +114,9 @@ public class ModelReturn { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -234,8 +244,10 @@ public class ModelReturn { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java index 46625eb3842..c9221c4667c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Name.java @@ -38,6 +38,7 @@ 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; @@ -162,6 +163,10 @@ public class Name { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Name instance itself */ public Name putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -173,6 +178,8 @@ public class Name { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -180,6 +187,9 @@ public class Name { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -327,8 +337,10 @@ public class Name { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 cadd5c9bed5..b9f76671e31 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 @@ -46,6 +46,7 @@ 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; @@ -550,16 +551,16 @@ public class NullableClass { if ((jsonObj.get("string_prop") != null && !jsonObj.get("string_prop").isJsonNull()) && !jsonObj.get("string_prop").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `string_prop` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_prop").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_nullable_prop").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_nullable_prop") != null && !jsonObj.get("array_nullable_prop").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_nullable_prop` to be an array in the JSON string but got `%s`", jsonObj.get("array_nullable_prop").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_and_items_nullable_prop").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_and_items_nullable_prop") != null && !jsonObj.get("array_and_items_nullable_prop").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_and_items_nullable_prop` to be an array in the JSON string but got `%s`", jsonObj.get("array_and_items_nullable_prop").toString())); } - // ensure the json data is an array - if (!jsonObj.get("array_items_nullable").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("array_items_nullable") != null && !jsonObj.get("array_items_nullable").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `array_items_nullable` to be an array in the JSON string but got `%s`", jsonObj.get("array_items_nullable").toString())); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java index 76ed0276d9d..5a8f5cf16e6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -39,6 +39,7 @@ 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; @@ -89,6 +90,10 @@ public class NumberOnly { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the NumberOnly instance itself */ public NumberOnly putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -100,6 +105,8 @@ public class NumberOnly { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -107,6 +114,9 @@ public class NumberOnly { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -234,8 +244,10 @@ public class NumberOnly { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 81633a463d0..019c6b38422 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 @@ -42,6 +42,7 @@ 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; @@ -187,6 +188,10 @@ public class ObjectWithDeprecatedFields { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ObjectWithDeprecatedFields instance itself */ public ObjectWithDeprecatedFields putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -198,6 +203,8 @@ public class ObjectWithDeprecatedFields { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -205,6 +212,9 @@ public class ObjectWithDeprecatedFields { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -294,8 +304,8 @@ public class ObjectWithDeprecatedFields { if (jsonObj.get("deprecatedRef") != null && !jsonObj.get("deprecatedRef").isJsonNull()) { DeprecatedObject.validateJsonObject(jsonObj.getAsJsonObject("deprecatedRef")); } - // ensure the json data is an array - if (!jsonObj.get("bars").isJsonArray()) { + // ensure the optional json data is an array if present + if (jsonObj.get("bars") != null && !jsonObj.get("bars").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `bars` to be an array in the JSON string but got `%s`", jsonObj.get("bars").toString())); } } @@ -352,8 +362,10 @@ public class ObjectWithDeprecatedFields { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java index da6dc68411f..3310e7a0ef0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Order.java @@ -39,6 +39,7 @@ 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; @@ -273,6 +274,10 @@ public class Order { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Order instance itself */ public Order putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -284,6 +289,8 @@ public class Order { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -291,6 +298,9 @@ public class Order { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -436,8 +446,10 @@ public class Order { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java index eaf4cbc9228..34fd2a1589b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -39,6 +39,7 @@ 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; @@ -143,6 +144,10 @@ public class OuterComposite { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OuterComposite instance itself */ public OuterComposite putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -154,6 +159,8 @@ public class OuterComposite { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -161,6 +168,9 @@ public class OuterComposite { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -297,8 +307,10 @@ public class OuterComposite { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ParentPet.java index cdb27e8560c..7ba6aa639e8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ParentPet.java @@ -39,6 +39,7 @@ 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; @@ -63,6 +64,10 @@ public class ParentPet extends GrandparentAnimal { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ParentPet instance itself */ public ParentPet putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -74,6 +79,8 @@ public class ParentPet extends GrandparentAnimal { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -81,6 +88,9 @@ public class ParentPet extends GrandparentAnimal { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -214,8 +224,10 @@ public class ParentPet extends GrandparentAnimal { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 1c506e68a82..7bd1f4d7842 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 @@ -42,6 +42,7 @@ 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; @@ -289,6 +290,10 @@ public class Pet { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Pet instance itself */ public Pet putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -300,6 +305,8 @@ public class Pet { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -307,6 +314,9 @@ public class Pet { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -411,8 +421,10 @@ public class Pet { if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - // ensure the json data is an array - if ((jsonObj.get("photoUrls") != null && !jsonObj.get("photoUrls").isJsonNull()) && !jsonObj.get("photoUrls").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("photoUrls") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("photoUrls").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj.get("photoUrls").toString())); } if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) { @@ -486,8 +498,10 @@ public class Pet { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } 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 94f5d943e17..ba9c69f5326 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 @@ -42,6 +42,7 @@ 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; @@ -286,6 +287,10 @@ public class PetWithRequiredTags { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PetWithRequiredTags instance itself */ public PetWithRequiredTags putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -297,6 +302,8 @@ public class PetWithRequiredTags { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -304,6 +311,9 @@ public class PetWithRequiredTags { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -409,8 +419,10 @@ public class PetWithRequiredTags { if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - // ensure the json data is an array - if ((jsonObj.get("photoUrls") != null && !jsonObj.get("photoUrls").isJsonNull()) && !jsonObj.get("photoUrls").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("photoUrls") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("photoUrls").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj.get("photoUrls").toString())); } // ensure the json data is an array @@ -480,8 +492,10 @@ public class PetWithRequiredTags { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index 887c057b99a..37e079c4255 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class QuadrilateralInterface { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the QuadrilateralInterface instance itself */ public QuadrilateralInterface putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class QuadrilateralInterface { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class QuadrilateralInterface { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -244,8 +254,10 @@ public class QuadrilateralInterface { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index ab474320677..5b912c8baef 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -38,6 +38,7 @@ 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; @@ -114,6 +115,10 @@ public class ReadOnlyFirst { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReadOnlyFirst instance itself */ public ReadOnlyFirst putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -125,6 +130,8 @@ public class ReadOnlyFirst { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -132,6 +139,9 @@ public class ReadOnlyFirst { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -268,8 +278,10 @@ public class ReadOnlyFirst { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 9c7d73ef973..997b3e8066b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -38,6 +38,7 @@ 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; @@ -115,6 +116,10 @@ public class ScaleneTriangle { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ScaleneTriangle instance itself */ public ScaleneTriangle putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -126,6 +131,8 @@ public class ScaleneTriangle { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -133,6 +140,9 @@ public class ScaleneTriangle { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -278,8 +288,10 @@ public class ScaleneTriangle { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeInterface.java index 14bfd02fffe..748b141957c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class ShapeInterface { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ShapeInterface instance itself */ public ShapeInterface putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class ShapeInterface { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class ShapeInterface { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -244,8 +254,10 @@ public class ShapeInterface { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 6296f4423fb..7dceb9321e3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -38,6 +38,7 @@ 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; @@ -115,6 +116,10 @@ public class SimpleQuadrilateral { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SimpleQuadrilateral instance itself */ public SimpleQuadrilateral putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -126,6 +131,8 @@ public class SimpleQuadrilateral { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -133,6 +140,9 @@ public class SimpleQuadrilateral { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -278,8 +288,10 @@ public class SimpleQuadrilateral { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java index 52f467174ce..d5e8d156207 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -38,6 +38,7 @@ 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; @@ -115,6 +116,10 @@ public class SpecialModelName { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SpecialModelName instance itself */ public SpecialModelName putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -126,6 +131,8 @@ public class SpecialModelName { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -133,6 +140,9 @@ public class SpecialModelName { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -266,8 +276,10 @@ public class SpecialModelName { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java index 64e7edf9617..75ea63b3581 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Tag.java @@ -38,6 +38,7 @@ 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; @@ -115,6 +116,10 @@ public class Tag { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Tag instance itself */ public Tag putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -126,6 +131,8 @@ public class Tag { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -133,6 +140,9 @@ public class Tag { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -266,8 +276,10 @@ public class Tag { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TriangleInterface.java index 481cc8ff83c..a5efe5af1af 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -38,6 +38,7 @@ 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; @@ -88,6 +89,10 @@ public class TriangleInterface { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TriangleInterface instance itself */ public TriangleInterface putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -99,6 +104,8 @@ public class TriangleInterface { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -106,6 +113,9 @@ public class TriangleInterface { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -244,8 +254,10 @@ public class TriangleInterface { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java index cdf8d7b86c0..205b0d92ab7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/User.java @@ -39,6 +39,7 @@ 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; @@ -386,6 +387,10 @@ public class User { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the User instance itself */ public User putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -397,6 +402,8 @@ public class User { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -404,6 +411,9 @@ public class User { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -593,8 +603,10 @@ public class User { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Whale.java index a2b89819cc4..455e69bf49e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Whale.java @@ -38,6 +38,7 @@ 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; @@ -142,6 +143,10 @@ public class Whale { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Whale instance itself */ public Whale putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -153,6 +158,8 @@ public class Whale { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -160,6 +167,9 @@ public class Whale { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -304,8 +314,10 @@ public class Whale { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Zebra.java index 61d7009c60a..75a51a5c9a9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Zebra.java @@ -38,6 +38,7 @@ 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; @@ -164,6 +165,10 @@ public class Zebra { /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Zebra instance itself */ public Zebra putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { @@ -175,6 +180,8 @@ public class Zebra { /** * Return the additional (undeclared) property. + * + * @return a map of objects */ public Map getAdditionalProperties() { return additionalProperties; @@ -182,6 +189,9 @@ public class Zebra { /** * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object */ public Object getAdditionalProperty(String key) { if (this.additionalProperties == null) { @@ -326,8 +336,10 @@ public class Zebra { instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); else throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); - } else { // non-primitive type - instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); } } } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java similarity index 64% rename from samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java rename to samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index c4fe8ec11cf..ead80b2d976 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -21,32 +21,33 @@ import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.openapitools.client.model.Foo; -import org.junit.jupiter.api.Assertions; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** - * Model tests for InlineResponseDefault + * Model tests for ArrayOfArrayOfNumberOnly */ -public class InlineResponseDefaultTest { - private final InlineResponseDefault model = new InlineResponseDefault(); +public class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** - * Model tests for InlineResponseDefault + * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testInlineResponseDefault() { - // TODO: test InlineResponseDefault + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly } /** - * Test the property 'string' + * Test the property 'arrayArrayNumber' */ @Test - public void stringTest() { - // TODO: test string + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber } } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerTest.java index 6c7738e8c96..4fc429aac71 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerTest.java @@ -21,8 +21,6 @@ import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.openapitools.client.model.ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf; -import org.openapitools.client.model.DogAllOf; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1Test.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1Test.java deleted file mode 100644 index 2716e8181df..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1Test.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 - */ -public class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1Test { - private final ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 model = new ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1(); - - /** - * Model tests for ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 - */ - @Test - public void testArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1() { - // TODO: test ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOfTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOfTest.java deleted file mode 100644 index 7a2a0b26a42..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOfTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.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 io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf - */ -public class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOfTest { - private final ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf model = new ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf(); - - /** - * Model tests for ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf - */ - @Test - public void testArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf() { - // TODO: test ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 00000000000..b7c97e88941 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml b/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml +++ b/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/rest-assured-jackson/build.gradle b/samples/client/petstore/java/rest-assured-jackson/build.gradle index acffdfa15a9..74f0d4f31f1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.gradle +++ b/samples/client/petstore/java/rest-assured-jackson/build.gradle @@ -100,9 +100,9 @@ ext { swagger_annotations_version = "1.6.6" rest_assured_version = "4.5.1" junit_version = "4.13.2" - jackson_version = "2.12.5" - jackson_databind_version = "2.12.6.1" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" okio_version = "1.17.5" } diff --git a/samples/client/petstore/java/rest-assured-jackson/build.sbt b/samples/client/petstore/java/rest-assured-jackson/build.sbt index 04546d3d932..13277bc9cb1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.sbt +++ b/samples/client/petstore/java/rest-assured-jackson/build.sbt @@ -13,11 +13,11 @@ lazy val root = (project in file(".")). "io.rest-assured" % "rest-assured" % "4.5.1", "io.rest-assured" % "scala-support" % "4.5.1", "com.google.code.findbugs" % "jsr305" % "3.0.2", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.5", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.12.5", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.12.6.1", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.4.1", "com.squareup.okio" % "okio" % "1.17.5" % "compile", "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", diff --git a/samples/client/petstore/java/rest-assured-jackson/pom.xml b/samples/client/petstore/java/rest-assured-jackson/pom.xml index c37159f4e0b..2b735ab2d45 100644 --- a/samples/client/petstore/java/rest-assured-jackson/pom.xml +++ b/samples/client/petstore/java/rest-assured-jackson/pom.xml @@ -286,9 +286,9 @@ 4.5.1 2.8.9 1.8.5 - 2.12.5 - 2.12.6.1 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 2.0.2 1.17.5 diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/rest-assured/api/openapi.yaml b/samples/client/petstore/java/rest-assured/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/rest-assured/api/openapi.yaml +++ b/samples/client/petstore/java/rest-assured/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/resteasy/api/openapi.yaml b/samples/client/petstore/java/resteasy/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/resteasy/api/openapi.yaml +++ b/samples/client/petstore/java/resteasy/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index 086b59a0603..b27a669e7c0 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -98,9 +98,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.10.5" - jackson_databind_version = "2.12.6.1" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" resteasy_version = "4.5.11.Final" diff --git a/samples/client/petstore/java/resteasy/build.sbt b/samples/client/petstore/java/resteasy/build.sbt index 69842e1cffe..fa0bd87c5d7 100644 --- a/samples/client/petstore/java/resteasy/build.sbt +++ b/samples/client/petstore/java/resteasy/build.sbt @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "4.5.11.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "4.5.11.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index 81448545a7f..3cb2cf735f4 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -255,9 +255,9 @@ UTF-8 1.6.3 4.7.6.Final - 2.10.5 - 2.12.6.1 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index 63ba5cd3162..cb264be6fbb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -98,9 +98,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.12.6.1" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" spring_web_version = "5.3.18" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index 405a56e26c6..624eb785c1a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -287,7 +287,7 @@ 5.3.18 2.12.7 2.12.7 - 0.2.3 + 0.2.4 1.3.5 1.0.0 4.13.2 diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/resttemplate/api/openapi.yaml b/samples/client/petstore/java/resttemplate/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/resttemplate/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index c26b802d2c0..d441c4e64bc 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -98,9 +98,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.12.6.1" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" spring_web_version = "5.3.18" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index 9401bad7840..c9a07f7160d 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -275,7 +275,7 @@ 5.3.18 2.12.7 2.12.7 - 0.2.3 + 0.2.4 1.3.5 1.0.0 4.13.2 diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml b/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/retrofit2-play26/build.gradle b/samples/client/petstore/java/retrofit2-play26/build.gradle index 49b13cac615..35b51632a9b 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.gradle +++ b/samples/client/petstore/java/retrofit2-play26/build.gradle @@ -99,9 +99,9 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" - jackson_version = "2.12.1" - jackson_databind_version = "2.12.6.1" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" play_version = "2.6.7" jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" diff --git a/samples/client/petstore/java/retrofit2-play26/build.sbt b/samples/client/petstore/java/retrofit2-play26/build.sbt index df9877da4a9..204954a6301 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.sbt +++ b/samples/client/petstore/java/retrofit2-play26/build.sbt @@ -14,9 +14,9 @@ lazy val root = (project in file(".")). "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.12.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", diff --git a/samples/client/petstore/java/retrofit2-play26/pom.xml b/samples/client/petstore/java/retrofit2-play26/pom.xml index 97caa57d218..bebce0b6c62 100644 --- a/samples/client/petstore/java/retrofit2-play26/pom.xml +++ b/samples/client/petstore/java/retrofit2-play26/pom.xml @@ -303,10 +303,10 @@ ${java.version} 1.8.3 1.6.3 - 2.12.1 - 2.12.6.1 + 2.13.4 + 2.13.4.2 2.6.7 - 0.2.3 + 0.2.4 2.5.0 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/retrofit2/api/openapi.yaml b/samples/client/petstore/java/retrofit2/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/retrofit2/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml b/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml b/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml b/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml +++ b/samples/client/petstore/java/vertx-no-nullable/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/vertx-no-nullable/build.gradle b/samples/client/petstore/java/vertx-no-nullable/build.gradle index 13bb5dcb712..b93c988fcf6 100644 --- a/samples/client/petstore/java/vertx-no-nullable/build.gradle +++ b/samples/client/petstore/java/vertx-no-nullable/build.gradle @@ -30,8 +30,8 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.10.5" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" vertx_version = "3.4.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 86cfc8a3472..2cba57bcefe 100644 --- a/samples/client/petstore/java/vertx-no-nullable/pom.xml +++ b/samples/client/petstore/java/vertx-no-nullable/pom.xml @@ -271,9 +271,9 @@ UTF-8 3.4.2 1.5.22 - 2.10.5 - 2.12.6.1 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/vertx/api/openapi.yaml b/samples/client/petstore/java/vertx/api/openapi.yaml index 151c0e7627d..5f55e8c53f4 100644 --- a/samples/client/petstore/java/vertx/api/openapi.yaml +++ b/samples/client/petstore/java/vertx/api/openapi.yaml @@ -2037,6 +2037,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2046,6 +2047,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2065,6 +2067,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2137,6 +2140,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2148,6 +2152,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2159,6 +2164,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index 74389c8993c..49c2693f9cf 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -30,11 +30,11 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.10.5" - jackson_databind_version = "2.12.6.1" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" vertx_version = "3.4.2" junit_version = "4.13.2" - jackson_databind_nullable_version = "0.2.3" + jackson_databind_nullable_version = "0.2.4" 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 00c432c9ca1..c2d6a6910b3 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -276,9 +276,9 @@ UTF-8 3.4.2 1.5.22 - 2.10.5 - 2.12.6.1 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/webclient-nulable-arrays/build.gradle b/samples/client/petstore/java/webclient-nulable-arrays/build.gradle index 180ae99a397..73bf10028f5 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/build.gradle +++ b/samples/client/petstore/java/webclient-nulable-arrays/build.gradle @@ -114,9 +114,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" spring_boot_version = "2.6.6" - jackson_version = "2.12.7" - jackson_databind_version = "2.12.7" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" reactor_netty_version = "1.0.4" diff --git a/samples/client/petstore/java/webclient-nulable-arrays/pom.xml b/samples/client/petstore/java/webclient-nulable-arrays/pom.xml index fbe8f876e7c..6c2c04735e2 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/pom.xml +++ b/samples/client/petstore/java/webclient-nulable-arrays/pom.xml @@ -127,9 +127,9 @@ UTF-8 1.6.3 2.6.6 - 2.12.7 - 2.12.7 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 4.13.2 3.4.3 diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java index 353a788d4db..cba5137810b 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ApiClient.java @@ -488,7 +488,7 @@ public class ApiClient extends JavaTimeFormatter { * @return boolean true if the MediaType represents JSON, false otherwise */ public boolean isJsonMime(MediaType mediaType) { - return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$")); + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); } /** diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle index 7d7eb506cd2..72bbe85dbd1 100644 --- a/samples/client/petstore/java/webclient/build.gradle +++ b/samples/client/petstore/java/webclient/build.gradle @@ -114,9 +114,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" spring_boot_version = "2.6.6" - jackson_version = "2.12.7" - jackson_databind_version = "2.12.7" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" reactor_netty_version = "1.0.4" diff --git a/samples/client/petstore/java/webclient/pom.xml b/samples/client/petstore/java/webclient/pom.xml index cda03fc3ee7..0623bf1c8be 100644 --- a/samples/client/petstore/java/webclient/pom.xml +++ b/samples/client/petstore/java/webclient/pom.xml @@ -127,9 +127,9 @@ UTF-8 1.6.3 2.6.6 - 2.12.7 - 2.12.7 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 4.13.2 3.4.3 diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java index b5c673453ca..a3b21aac840 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java @@ -509,7 +509,7 @@ public class ApiClient extends JavaTimeFormatter { * @return boolean true if the MediaType represents JSON, false otherwise */ public boolean isJsonMime(MediaType mediaType) { - return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$")); + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); } /** diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/client/petstore/kotlin-allOff-discriminator/README.md b/samples/client/petstore/kotlin-allOff-discriminator/README.md index 6b1ed0fb321..b8f74b27424 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/README.md +++ b/samples/client/petstore/kotlin-allOff-discriminator/README.md @@ -12,8 +12,8 @@ For more information, please visit [https://example.org](https://example.org) ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Animal.kt index df2cbb2bfa7..f3a877f5a8e 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Animal.kt +++ b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -24,6 +24,7 @@ import com.squareup.moshi.Json * @param id */ + interface Animal { @Json(name = "id") diff --git a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Bird.kt b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Bird.kt index 9cf419d67c4..64a248fcc3b 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Bird.kt +++ b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/Bird.kt @@ -26,6 +26,7 @@ import com.squareup.moshi.Json * @param featherType */ + data class Bird ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/BirdAllOf.kt b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/BirdAllOf.kt index dd4054e9038..8399afe304a 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/BirdAllOf.kt +++ b/samples/client/petstore/kotlin-allOff-discriminator/src/main/kotlin/org/openapitools/client/models/BirdAllOf.kt @@ -24,6 +24,7 @@ import com.squareup.moshi.Json * @param featherType */ + data class BirdAllOf ( @Json(name = "featherType") diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp3/README.md b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp3/README.md index be47543f963..49b1c94dab6 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp3/README.md +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp3/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/README.md b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/README.md index be47543f963..49b1c94dab6 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/README.md +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index fd07e4229d1..529ae1e4d05 100644 --- a/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -4,13 +4,13 @@ import io.ktor.client.HttpClient import io.ktor.client.HttpClientConfig import io.ktor.client.engine.HttpClientEngine import io.ktor.client.plugins.contentnegotiation.ContentNegotiation -import io.ktor.serialization.kotlinx.json.* import io.ktor.client.request.* import io.ktor.client.request.forms.FormDataContent import io.ktor.client.request.forms.MultiPartFormDataContent import io.ktor.client.request.header import io.ktor.client.request.parameter import io.ktor.client.statement.HttpResponse +import io.ktor.serialization.kotlinx.json.json import io.ktor.http.* import io.ktor.http.content.PartData import kotlin.Unit @@ -142,9 +142,9 @@ open class ApiClient( } this.method = requestConfig.method.httpMethod headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } - if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { this.setBody(body) - + } } } diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index fd07e4229d1..529ae1e4d05 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -4,13 +4,13 @@ import io.ktor.client.HttpClient import io.ktor.client.HttpClientConfig import io.ktor.client.engine.HttpClientEngine import io.ktor.client.plugins.contentnegotiation.ContentNegotiation -import io.ktor.serialization.kotlinx.json.* import io.ktor.client.request.* import io.ktor.client.request.forms.FormDataContent import io.ktor.client.request.forms.MultiPartFormDataContent import io.ktor.client.request.header import io.ktor.client.request.parameter import io.ktor.client.statement.HttpResponse +import io.ktor.serialization.kotlinx.json.json import io.ktor.http.* import io.ktor.http.content.PartData import kotlin.Unit @@ -142,9 +142,9 @@ open class ApiClient( } this.method = requestConfig.method.httpMethod headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } - if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { this.setBody(body) - + } } } diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt index d2a5502173d..08e06c597b4 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -31,6 +31,7 @@ import kotlinx.serialization.encoding.* * @param gepa */ @Serializable + data class Apa ( @SerialName(value = "bepa") @Required val bepa: kotlin.Double = (0).toDouble(), diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/README.md b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/README.md index e1589aead68..ccbdb1a4e4a 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/README.md +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt index ca2a4a45dfa..d9c29f04f16 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -29,6 +29,7 @@ import com.squareup.moshi.Json * @param gepa */ + data class Apa ( @Json(name = "bepa") diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp3/README.md b/samples/client/petstore/kotlin-default-values-jvm-okhttp3/README.md index 96bddb2ac98..c1b435ada57 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp3/README.md +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp3/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp3/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp3/src/main/kotlin/org/openapitools/client/models/Apa.kt index 4455c9a2ae6..4f411ca589d 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp3/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp3/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -27,6 +27,7 @@ import com.squareup.moshi.Json * @param n1 */ + data class Apa ( @Json(name = "i0") diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/README.md b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/README.md index 96bddb2ac98..c1b435ada57 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/README.md +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt index 4455c9a2ae6..4f411ca589d 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -27,6 +27,7 @@ import com.squareup.moshi.Json * @param n1 */ + data class Apa ( @Json(name = "i0") diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/README.md b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/README.md index 904786dd56b..be72f0dfcf6 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/README.md +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt index 4455c9a2ae6..4f411ca589d 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -27,6 +27,7 @@ import com.squareup.moshi.Json * @param n1 */ + data class Apa ( @Json(name = "i0") diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/models/Apa.kt index 2e89541e501..aca90dd3533 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -29,6 +29,7 @@ import org.openapitools.client.infrastructure.ITransformForStorage * @param n1 */ + data class Apa ( @SerializedName("i0") diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index fd07e4229d1..529ae1e4d05 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -4,13 +4,13 @@ import io.ktor.client.HttpClient import io.ktor.client.HttpClientConfig import io.ktor.client.engine.HttpClientEngine import io.ktor.client.plugins.contentnegotiation.ContentNegotiation -import io.ktor.serialization.kotlinx.json.* import io.ktor.client.request.* import io.ktor.client.request.forms.FormDataContent import io.ktor.client.request.forms.MultiPartFormDataContent import io.ktor.client.request.header import io.ktor.client.request.parameter import io.ktor.client.statement.HttpResponse +import io.ktor.serialization.kotlinx.json.json import io.ktor.http.* import io.ktor.http.content.PartData import kotlin.Unit @@ -142,9 +142,9 @@ open class ApiClient( } this.method = requestConfig.method.httpMethod headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } - if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { this.setBody(body) - + } } } diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt index d09beda60f6..339fa40ec1b 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -29,6 +29,7 @@ import kotlinx.serialization.encoding.* * @param n1 */ @Serializable + data class Apa ( @SerialName(value = "i0") @Required val i0: kotlin.Int, diff --git a/samples/client/petstore/kotlin-default-values-numbers/src/main/kotlin/org/openapitools/client/models/ModelWithPropertyHavingDefault.kt b/samples/client/petstore/kotlin-default-values-numbers/src/main/kotlin/org/openapitools/client/models/ModelWithPropertyHavingDefault.kt index 5bba4b2acd5..97e1f304f1b 100644 --- a/samples/client/petstore/kotlin-default-values-numbers/src/main/kotlin/org/openapitools/client/models/ModelWithPropertyHavingDefault.kt +++ b/samples/client/petstore/kotlin-default-values-numbers/src/main/kotlin/org/openapitools/client/models/ModelWithPropertyHavingDefault.kt @@ -31,6 +31,7 @@ import com.google.gson.annotations.SerializedName * @param propertyDouble3 */ + data class ModelWithPropertyHavingDefault ( @SerializedName("propertyInt") diff --git a/samples/client/petstore/kotlin-enum-default-value/README.md b/samples/client/petstore/kotlin-enum-default-value/README.md index df4685a2021..665d7352870 100644 --- a/samples/client/petstore/kotlin-enum-default-value/README.md +++ b/samples/client/petstore/kotlin-enum-default-value/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt index 6dc3db67b03..7e59221aca3 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt @@ -25,6 +25,7 @@ import java.io.Serializable * @param propertyName */ + data class ModelWithEnumPropertyHavingDefault ( @Json(name = "propertyName") diff --git a/samples/client/petstore/kotlin-gson/README.md b/samples/client/petstore/kotlin-gson/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-gson/README.md +++ b/samples/client/petstore/kotlin-gson/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt index 50fff2dafc6..2601d6552e7 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,6 +25,7 @@ import com.google.gson.annotations.SerializedName * @param name */ + data class Category ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index f52e01cb0dc..683e7501919 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -26,6 +26,7 @@ import com.google.gson.annotations.SerializedName * @param message */ + data class ModelApiResponse ( @SerializedName("code") diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt index 8774e79d5c7..81eb2947f31 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -29,6 +29,7 @@ import com.google.gson.annotations.SerializedName * @param complete */ + data class Order ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 1e11a67331d..8cbd43cc64f 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -31,6 +31,7 @@ import com.google.gson.annotations.SerializedName * @param status pet status in the store */ + data class Pet ( @SerializedName("name") diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt index e9443d15a46..c2962c214a1 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,6 +25,7 @@ import com.google.gson.annotations.SerializedName * @param name */ + data class Tag ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt index 6ee2fca147d..8c93d094308 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -31,6 +31,7 @@ import com.google.gson.annotations.SerializedName * @param userStatus User Status */ + data class User ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jackson/README.md b/samples/client/petstore/kotlin-jackson/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-jackson/README.md +++ b/samples/client/petstore/kotlin-jackson/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index 5f02a113b82..71a7d74b06f 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param name */ + data class Category ( @field:JsonProperty("id") diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 3ef775bc663..5590e88cd83 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param message */ + data class ModelApiResponse ( @field:JsonProperty("code") diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index 75055dc6574..ae6f6bc3b9f 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -29,6 +29,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param complete */ + data class Order ( @field:JsonProperty("id") diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index c7f0d70984b..ea5a3dce8c4 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -31,6 +31,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param status pet status in the store */ + data class Pet ( @field:JsonProperty("name") diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index 591bb4230b9..f5f600cc374 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param name */ + data class Tag ( @field:JsonProperty("id") diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index c079f8f1671..7872ed7da4d 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -31,6 +31,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param userStatus User Status */ + data class User ( @field:JsonProperty("id") diff --git a/samples/client/petstore/kotlin-json-request-string/README.md b/samples/client/petstore/kotlin-json-request-string/README.md index eb18a4c21d8..928a13052e7 100644 --- a/samples/client/petstore/kotlin-json-request-string/README.md +++ b/samples/client/petstore/kotlin-json-request-string/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt index 6a0d0a49a7c..11197683145 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -35,6 +35,7 @@ import kotlinx.parcelize.Parcelize */ @Parcelize @Serializable + data class Category ( @SerialName(value = "id") diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 196cda362e7..9eced3daa38 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -36,6 +36,7 @@ import kotlinx.parcelize.Parcelize */ @Parcelize @Serializable + data class ModelApiResponse ( @SerialName(value = "code") diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt index 6910263b8cf..10faddb662d 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -39,6 +39,7 @@ import kotlinx.parcelize.Parcelize */ @Parcelize @Serializable + data class Order ( @SerialName(value = "id") diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt index 8922075ac94..319d5b237c3 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -41,6 +41,7 @@ import kotlinx.parcelize.Parcelize */ @Parcelize @Serializable + data class Pet ( @SerialName(value = "name") diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt index 34beab98314..dfbf3a6be9b 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -35,6 +35,7 @@ import kotlinx.parcelize.Parcelize */ @Parcelize @Serializable + data class Tag ( @SerialName(value = "id") diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt index 3b2b0605024..e2103333485 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt @@ -41,6 +41,7 @@ import kotlinx.parcelize.Parcelize */ @Parcelize @Serializable + data class User ( @SerialName(value = "id") diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/README.md b/samples/client/petstore/kotlin-jvm-ktor-gson/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/README.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/build.gradle b/samples/client/petstore/kotlin-jvm-ktor-gson/build.gradle index 0c3e6b64c92..67441d77a6a 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/build.gradle +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/build.gradle @@ -8,7 +8,7 @@ wrapper { buildscript { ext.kotlin_version = '1.6.10' - ext.ktor_version = '2.0.3' + ext.ktor_version = '2.1.2' repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 5d6fc3af68b..69c803dfbcf 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -12,6 +12,7 @@ import io.ktor.client.request.parameter import io.ktor.client.request.request import io.ktor.client.request.setBody import io.ktor.client.statement.HttpResponse +import io.ktor.http.contentType import io.ktor.http.HttpHeaders import io.ktor.http.HttpMethod import io.ktor.http.Parameters @@ -23,11 +24,6 @@ import io.ktor.http.takeFrom import io.ktor.serialization.gson.* import com.google.gson.GsonBuilder import java.text.DateFormat -import org.openapitools.client.auth.ApiKeyAuth -import org.openapitools.client.auth.Authentication -import org.openapitools.client.auth.HttpBasicAuth -import org.openapitools.client.auth.HttpBearerAuth -import org.openapitools.client.auth.OAuth import org.openapitools.client.auth.* open class ApiClient( @@ -71,7 +67,7 @@ open class ApiClient( * @param username Username */ fun setUsername(username: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.username = username } @@ -82,7 +78,7 @@ open class ApiClient( * @param password Password */ fun setPassword(password: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.password = password } @@ -94,7 +90,7 @@ open class ApiClient( * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKey(apiKey: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKey = apiKey } @@ -106,7 +102,7 @@ open class ApiClient( * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKeyPrefix = apiKeyPrefix } @@ -117,7 +113,7 @@ open class ApiClient( * @param accessToken Access token */ fun setAccessToken(accessToken: String) { - val auth = authentications.values.firstOrNull { it is OAuth } as OAuth? + val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth? ?: throw Exception("No OAuth2 authentication configured") auth.accessToken = accessToken } @@ -128,7 +124,7 @@ open class ApiClient( * @param bearerToken The bearer token. */ fun setBearerToken(bearerToken: String) { - val auth = authentications.values.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? ?: throw Exception("No Bearer authentication configured") auth.bearerToken = bearerToken } @@ -159,8 +155,9 @@ open class ApiClient( } this.method = requestConfig.method.httpMethod headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } - if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { setBody(body) + } } } diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Category.kt index 50fff2dafc6..2601d6552e7 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,6 +25,7 @@ import com.google.gson.annotations.SerializedName * @param name */ + data class Category ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index f52e01cb0dc..683e7501919 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -26,6 +26,7 @@ import com.google.gson.annotations.SerializedName * @param message */ + data class ModelApiResponse ( @SerializedName("code") diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Order.kt index 5d9240bc46a..13d33912dc0 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -29,6 +29,7 @@ import com.google.gson.annotations.SerializedName * @param complete */ + data class Order ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 2a7be8be765..3d52e65fa75 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -31,6 +31,7 @@ import com.google.gson.annotations.SerializedName * @param status pet status in the store */ + data class Pet ( @SerializedName("name") diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt index e9443d15a46..c2962c214a1 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,6 +25,7 @@ import com.google.gson.annotations.SerializedName * @param name */ + data class Tag ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/User.kt index 6ee2fca147d..8c93d094308 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -31,6 +31,7 @@ import com.google.gson.annotations.SerializedName * @param userStatus User Status */ + data class User ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/README.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/README.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle b/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle index febcd440b1e..072128b1cec 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle @@ -8,7 +8,7 @@ wrapper { buildscript { ext.kotlin_version = '1.6.10' - ext.ktor_version = '2.0.3' + ext.ktor_version = '2.1.2' repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index e21bccb9060..bb3a5290cf6 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -12,6 +12,7 @@ import io.ktor.client.request.parameter import io.ktor.client.request.request import io.ktor.client.request.setBody import io.ktor.client.statement.HttpResponse +import io.ktor.http.contentType import io.ktor.http.HttpHeaders import io.ktor.http.HttpMethod import io.ktor.http.Parameters @@ -27,11 +28,6 @@ import com.fasterxml.jackson.databind.SerializationFeature import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com.fasterxml.jackson.core.util.DefaultIndenter import com.fasterxml.jackson.core.util.DefaultPrettyPrinter -import org.openapitools.client.auth.ApiKeyAuth -import org.openapitools.client.auth.Authentication -import org.openapitools.client.auth.HttpBasicAuth -import org.openapitools.client.auth.HttpBearerAuth -import org.openapitools.client.auth.OAuth import org.openapitools.client.auth.* open class ApiClient( @@ -79,7 +75,7 @@ open class ApiClient( * @param username Username */ fun setUsername(username: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.username = username } @@ -90,7 +86,7 @@ open class ApiClient( * @param password Password */ fun setPassword(password: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.password = password } @@ -102,7 +98,7 @@ open class ApiClient( * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKey(apiKey: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKey = apiKey } @@ -114,7 +110,7 @@ open class ApiClient( * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKeyPrefix = apiKeyPrefix } @@ -125,7 +121,7 @@ open class ApiClient( * @param accessToken Access token */ fun setAccessToken(accessToken: String) { - val auth = authentications.values.firstOrNull { it is OAuth } as OAuth? + val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth? ?: throw Exception("No OAuth2 authentication configured") auth.accessToken = accessToken } @@ -136,7 +132,7 @@ open class ApiClient( * @param bearerToken The bearer token. */ fun setBearerToken(bearerToken: String) { - val auth = authentications.values.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? ?: throw Exception("No Bearer authentication configured") auth.bearerToken = bearerToken } @@ -167,8 +163,9 @@ open class ApiClient( } this.method = requestConfig.method.httpMethod headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } - if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { setBody(body) + } } } diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt index 5f02a113b82..71a7d74b06f 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param name */ + data class Category ( @field:JsonProperty("id") diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 3ef775bc663..5590e88cd83 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param message */ + data class ModelApiResponse ( @field:JsonProperty("code") diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt index fbb813a47e2..bfedd1b5284 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -29,6 +29,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param complete */ + data class Order ( @field:JsonProperty("id") diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt index e1e53044dde..ba5fd69df76 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -31,6 +31,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param status pet status in the store */ + data class Pet ( @field:JsonProperty("name") diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt index 591bb4230b9..f5f600cc374 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param name */ + data class Tag ( @field:JsonProperty("id") diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt index c079f8f1671..7872ed7da4d 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -31,6 +31,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param userStatus User Status */ + data class User ( @field:JsonProperty("id") diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt index efdde72015f..e52d3776b4a 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param name */ + data class Category ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 70862a29ee2..544e4cb37f3 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -27,6 +27,7 @@ import java.io.Serializable * @param message */ + data class ModelApiResponse ( @SerializedName("code") diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt index 49274482e4f..a3700c21275 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -30,6 +30,7 @@ import java.io.Serializable * @param complete */ + data class Order ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt index 2abf3d44e9f..3888433f78a 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -32,6 +32,7 @@ import java.io.Serializable * @param status pet status in the store */ + data class Pet ( @SerializedName("name") diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt index 30a782898df..6594820a4b1 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param name */ + data class Tag ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt index 336d9f4f985..c20fc41911f 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt @@ -32,6 +32,7 @@ import java.io.Serializable * @param userStatus User Status */ + data class User ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/.openapi-generator-ignore b/samples/client/petstore/kotlin-jvm-vertx-gson/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-vertx-gson/.openapi-generator/FILES new file mode 100644 index 00000000000..026c801de8e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/.openapi-generator/FILES @@ -0,0 +1,34 @@ +README.md +build.gradle +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 +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-vertx-gson/.openapi-generator/VERSION new file mode 100644 index 00000000000..d6b4ec4aa78 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/README.md b/samples/client/petstore/kotlin-jvm-vertx-gson/README.md new file mode 100644 index 00000000000..e3f2108bfcd --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/README.md @@ -0,0 +1,99 @@ +# org.openapitools.client - Kotlin client library for 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. + +## 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.KotlinClientCodegen + +## Requires + +* Kotlin 1.6.10 +* Gradle 7.5 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/build.gradle b/samples/client/petstore/kotlin-jvm-vertx-gson/build.gradle new file mode 100644 index 00000000000..5dbc1fb23d5 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/build.gradle @@ -0,0 +1,39 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '7.5' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.6.10' + ext.vertx_version = "4.3.3" + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "com.google.code.gson:gson:2.9.0" + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" + implementation "io.vertx:vertx-web-client:$vertx_version" + implementation "io.vertx:vertx-core:$vertx_version" + implementation "io.vertx:vertx-lang-kotlin:$vertx_version" + implementation "io.vertx:vertx-uri-template:$vertx_version" +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/ApiResponse.md new file mode 100644 index 00000000000..12f08d5cdef --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ModelApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Category.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Category.md new file mode 100644 index 00000000000..2c28a670fc7 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Order.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Order.md new file mode 100644 index 00000000000..94ab0d537e5 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#Status) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Pet.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Pet.md new file mode 100644 index 00000000000..bc3dd89718f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.collections.List<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#Status) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md new file mode 100644 index 00000000000..6962f148b59 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md @@ -0,0 +1,417 @@ +# 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** +> Pet addPet(pet) + +Add a new pet to the store + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + val result : Pet = apiInstance.addPet(pet) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.collections.List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter +try { + val result : kotlin.collections.List = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.collections.List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by +try { + val result : kotlin.collections.List = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> Pet updatePet(pet) + +Update an existing pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + val result : Pet = apiInstance.updatePet(pet) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md new file mode 100644 index 00000000000..68fbd1fecf9 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md @@ -0,0 +1,198 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Tag.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/User.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/User.md new file mode 100644 index 00000000000..e801729b5ed --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md new file mode 100644 index 00000000000..e674269be5e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md @@ -0,0 +1,404 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.collections.List = // kotlin.collections.List | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.collections.List = // kotlin.collections.List | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e708b1c023e Binary files /dev/null and b/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..8cf6eb5ad22 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew b/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew new file mode 100644 index 00000000000..4f906e0c811 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat new file mode 100644 index 00000000000..107acd32c4e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/settings.gradle b/samples/client/petstore/kotlin-jvm-vertx-gson/settings.gradle new file mode 100644 index 00000000000..555e588800d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-jvm-vertx' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 00000000000..1acf5003212 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,591 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.ModelApiResponse +import org.openapitools.client.models.Pet + +import com.google.gson.reflect.TypeToken +import com.google.gson.annotations.SerializedName + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class PetApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPet(pet: Pet) : Future { + return addPetWithHttpInfo(pet = pet).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun addPetWithHttpInfo(pet: Pet) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet")) + + + + + request.putHeader("Content-Type", "application/json") + request.putHeader("Content-Type", "application/xml") + + request.putHeader("Accept", "application/xml, application/json") + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .sendBuffer(responseBody(pet)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null) : Future { + return deletePetWithHttpInfo(petId = petId, apiKey = apiKey).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + + apiKey?.apply { request.putHeader("api_key", this.toString())} + + + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold") + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatus(status: kotlin.collections.List) : Future> { + return findPetsByStatusWithHttpInfo(status = status).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/findByStatus")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + status.let { request.queryParams().add("status", toMultiValue(it.toList(), "csv")) } + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTags(tags: kotlin.collections.List) : Future> { + return findPetsByTagsWithHttpInfo(tags = tags).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/findByTags")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + tags.let { request.queryParams().add("tags", toMultiValue(it.toList(), "csv")) } + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetById(petId: kotlin.Long) : Future { + return getPetByIdWithHttpInfo(petId = petId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePet(pet: Pet) : Future { + return updatePetWithHttpInfo(pet = pet).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun updatePetWithHttpInfo(pet: Pet) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.PUT, UriTemplate.of("$basePath/pet")) + + + + + request.putHeader("Content-Type", "application/json") + request.putHeader("Content-Type", "application/xml") + + request.putHeader("Accept", "application/xml, application/json") + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .sendBuffer(responseBody(pet)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null) : Future { + return updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + request.putHeader("Content-Type", "application/x-www-form-urlencoded") + + + + + val form = io.vertx.core.MultiMap.caseInsensitiveMultiMap(); + name?.let { form.add("name", name) } + status?.let { form.add("status", status) } + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ModelApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null) : Future { + return uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet/{petId}/uploadImage".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + request.putHeader("Content-Type", "multipart/form-data") + + + request.putHeader("Accept", "application/json") + + val form = io.vertx.core.MultiMap.caseInsensitiveMultiMap(); + additionalMetadata?.let { form.add("additionalMetadata", additionalMetadata) } + file?.let { form.add("file", file.toString()) } + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.gson.toJson(body, T::class.java)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 00000000000..95c23914905 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,292 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.Order + +import com.google.gson.reflect.TypeToken +import com.google.gson.annotations.SerializedName + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class StoreApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrder(orderId: kotlin.String) : Future { + return deleteOrderWithHttpInfo(orderId = orderId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())))) + + + + + + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventory() : Future> { + return getInventoryWithHttpInfo().map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getInventoryWithHttpInfo() : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/store/inventory")) + + + + + request.putHeader("Accept", "application/json") + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderById(orderId: kotlin.Long) : Future { + return getOrderByIdWithHttpInfo(orderId = orderId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrder(order: Order) : Future { + return placeOrderWithHttpInfo(order = order).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun placeOrderWithHttpInfo(order: Order) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/store/order")) + + + + + request.putHeader("Content-Type", "application/json") + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .sendBuffer(responseBody(order)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.gson.toJson(body, T::class.java)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 00000000000..df8f8ef39ef --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,573 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.User + +import com.google.gson.reflect.TypeToken +import com.google.gson.annotations.SerializedName + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class UserApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUser(user: User) : Future { + return createUserWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUserWithHttpInfo(user: User) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInput(user: kotlin.collections.List) : Future { + return createUsersWithArrayInputWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUsersWithArrayInputWithHttpInfo(user: kotlin.collections.List) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user/createWithArray")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInput(user: kotlin.collections.List) : Future { + return createUsersWithListInputWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUsersWithListInputWithHttpInfo(user: kotlin.collections.List) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user/createWithList")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUser(username: kotlin.String) : Future { + return deleteUserWithHttpInfo(username = username).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByName(username: kotlin.String) : Future { + return getUserByNameWithHttpInfo(username = username).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUser(username: kotlin.String, password: kotlin.String) : Future { + return loginUserWithHttpInfo(username = username, password = password).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/login")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + username.let { request.queryParams().add("username", listOf(it.toString())) } + password.let { request.queryParams().add("password", listOf(it.toString())) } + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Logs out current logged in user session + * + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUser() : Future { + return logoutUserWithHttpInfo().map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Logs out current logged in user session + * + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun logoutUserWithHttpInfo() : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/logout")) + + + + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUser(username: kotlin.String, user: User) : Future { + return updateUserWithHttpInfo(username = username, user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun updateUserWithHttpInfo(username: kotlin.String, user: User) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.PUT, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.gson.toJson(body, T::class.java)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..ef7a8f1e1a6 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..d72cc482b8c --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,86 @@ +package org.openapitools.client.infrastructure + +import io.vertx.core.Vertx +import io.vertx.core.buffer.Buffer +import java.nio.charset.StandardCharsets +import com.google.gson.reflect.TypeToken + +open class ApiClient(val basePath: kotlin.String = defaultBasePath, val accessToken: String? = null, val apiKey: MutableMap = mutableMapOf(), val apiKeyPrefix: MutableMap = mutableMapOf(), var username: String? = null, var password: String? = null, val vertx: Vertx) { + companion object { + const val baseUrlKey = "org.openapitools.client.baseUrl" + + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") + } + } + + protected inline fun handleResponse(response: io.vertx.ext.web.client.HttpResponse): ApiResponse { + val code = response.statusCode() + val headers = response.headers().associate { it.key to listOf(it.value) } + val contentType = headers["Content-Type"]?.firstOrNull()?.substringBefore(";")?.lowercase(java.util.Locale.getDefault()) + + return when (code) { + in 100..199 -> Informational( + response.statusMessage(), + code, + headers + ) + in 200 .. 299 -> Success( + responseBody(response.body(), contentType), + code, + headers + ) + in 300..399 -> Redirection( + code, + headers + ) + in 400..499 -> ClientError( + response.statusMessage(), + response.bodyAsString(), + code, + headers + ) + else -> ServerError( + response.statusMessage(), + response.bodyAsString(), + code, + headers + ) + } + } + + protected inline fun responseBody(body: Buffer?, mediaType: String? = "application/json"): T? { + body ?: return null + + val bodyContent = String(body.bytes, StandardCharsets.UTF_8) + if (bodyContent.isEmpty()) { + return null + } + + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + protected fun encodeURIComponent(parameter: String): String { + return try { + java.net.URLEncoder.encode(parameter, java.nio.charset.StandardCharsets.UTF_8.name()) + } catch (e: java.io.UnsupportedEncodingException) { + parameter + } + } + + protected inline fun parseDateToQueryString(value : T): String { + /* + .replace("\"", "") converts the json object string to an actual string for the query parameter. + The moshi or gson adapter allows a more generic solution instead of trying to use a native + formatter. It also easily allows to provide a simple way to define a custom date format pattern + inside a gson/moshi adapter. + */ + return Serializer.gson.toJson(value, T::class.java).replace("\"", "") + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 00000000000..cf2cfaa95d9 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 00000000000..6120b081929 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 00000000000..b5310e71f13 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,18 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 00000000000..30ef6697183 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 00000000000..3ad781c66ca --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 00000000000..e615135c9cc --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: OffsetDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): OffsetDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return OffsetDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..6e16e4f6582 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,22 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.util.UUID + +object Serializer { + @JvmStatic + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + + @JvmStatic + val gson: Gson by lazy { + gsonBuilder.create() + } +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..2601d6552e7 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,38 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** + * A category for a pet + * + * @param id + * @param name + */ + + +data class Category ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt new file mode 100644 index 00000000000..683e7501919 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -0,0 +1,42 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + + +data class ModelApiResponse ( + + @SerializedName("code") + val code: kotlin.Int? = null, + + @SerializedName("type") + val type: kotlin.String? = null, + + @SerializedName("message") + val message: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 00000000000..81eb2947f31 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,67 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** + * An order for a pets from the pet store + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + + +data class Order ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("petId") + val petId: kotlin.Long? = null, + + @SerializedName("quantity") + val quantity: kotlin.Int? = null, + + @SerializedName("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + + /* Order Status */ + @SerializedName("status") + val status: Order.Status? = null, + + @SerializedName("complete") + val complete: kotlin.Boolean? = false + +) { + + /** + * Order Status + * + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String) { + @SerializedName(value = "placed") placed("placed"), + @SerializedName(value = "approved") approved("approved"), + @SerializedName(value = "delivered") delivered("delivered"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..724e4845b7c --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,70 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName + +/** + * A pet for sale in the pet store + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + + +data class Pet ( + + @SerializedName("name") + val name: kotlin.String, + + @SerializedName("photoUrls") + val photoUrls: kotlin.collections.List, + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("category") + val category: Category? = null, + + @SerializedName("tags") + val tags: kotlin.collections.List? = null, + + /* pet status in the store */ + @SerializedName("status") + @Deprecated(message = "This property is deprecated.") + val status: Pet.Status? = null + +) { + + /** + * pet status in the store + * + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String) { + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..c2962c214a1 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,38 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** + * A tag for a pet + * + * @param id + * @param name + */ + + +data class Tag ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 00000000000..8c93d094308 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,63 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** + * A User who is purchasing from the pet store + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + + +data class User ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("username") + val username: kotlin.String? = null, + + @SerializedName("firstName") + val firstName: kotlin.String? = null, + + @SerializedName("lastName") + val lastName: kotlin.String? = null, + + @SerializedName("email") + val email: kotlin.String? = null, + + @SerializedName("password") + val password: kotlin.String? = null, + + @SerializedName("phone") + val phone: kotlin.String? = null, + + /* User Status */ + @SerializedName("userStatus") + val userStatus: kotlin.Int? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/.openapi-generator-ignore b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/.openapi-generator/FILES new file mode 100644 index 00000000000..b468a696e09 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/.openapi-generator/FILES @@ -0,0 +1,30 @@ +README.md +build.gradle +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 +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/.openapi-generator/VERSION new file mode 100644 index 00000000000..d6b4ec4aa78 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/README.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/README.md new file mode 100644 index 00000000000..e3f2108bfcd --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/README.md @@ -0,0 +1,99 @@ +# org.openapitools.client - Kotlin client library for 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. + +## 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.KotlinClientCodegen + +## Requires + +* Kotlin 1.6.10 +* Gradle 7.5 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/build.gradle b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/build.gradle new file mode 100644 index 00000000000..563f957e3f6 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/build.gradle @@ -0,0 +1,43 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '7.5' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.6.10' + ext.vertx_version = "4.3.3" + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3" + implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.13.3" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.3" + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" + implementation "io.vertx:vertx-web-client:$vertx_version" + implementation "io.vertx:vertx-core:$vertx_version" + implementation "io.vertx:vertx-lang-kotlin:$vertx_version" + implementation "io.vertx:vertx-uri-template:$vertx_version" + implementation "io.vertx:vertx-lang-kotlin-coroutines:$vertx_version" +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/ApiResponse.md new file mode 100644 index 00000000000..12f08d5cdef --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ModelApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Category.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Category.md new file mode 100644 index 00000000000..2c28a670fc7 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Order.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Order.md new file mode 100644 index 00000000000..94ab0d537e5 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#Status) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Pet.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Pet.md new file mode 100644 index 00000000000..bc3dd89718f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.collections.List<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#Status) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md new file mode 100644 index 00000000000..6962f148b59 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md @@ -0,0 +1,417 @@ +# 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** +> Pet addPet(pet) + +Add a new pet to the store + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + val result : Pet = apiInstance.addPet(pet) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.collections.List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter +try { + val result : kotlin.collections.List = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.collections.List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by +try { + val result : kotlin.collections.List = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> Pet updatePet(pet) + +Update an existing pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + val result : Pet = apiInstance.updatePet(pet) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md new file mode 100644 index 00000000000..68fbd1fecf9 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md @@ -0,0 +1,198 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Tag.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/User.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/User.md new file mode 100644 index 00000000000..e801729b5ed --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md new file mode 100644 index 00000000000..e674269be5e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md @@ -0,0 +1,404 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.collections.List = // kotlin.collections.List | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.collections.List = // kotlin.collections.List | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e708b1c023e Binary files /dev/null and b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..8cf6eb5ad22 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew new file mode 100644 index 00000000000..4f906e0c811 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew.bat new file mode 100644 index 00000000000..107acd32c4e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/settings.gradle b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/settings.gradle new file mode 100644 index 00000000000..555e588800d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-jvm-vertx' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 00000000000..6a0b15a2f96 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,595 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.ModelApiResponse +import org.openapitools.client.models.Pet + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.type.TypeReference + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + +import io.vertx.kotlin.coroutines.await +import io.vertx.kotlin.coroutines.dispatcher +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class PetApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun addPet(pet: Pet) : Pet { + return addPetWithHttpInfo(pet = pet).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun addPetWithHttpInfo(pet: Pet) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet")) + + + + + request.putHeader("Content-Type", "application/json") + request.putHeader("Content-Type", "application/xml") + + request.putHeader("Accept", "application/xml, application/json") + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .sendBuffer(responseBody(pet)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null) : Unit { + return deletePetWithHttpInfo(petId = petId, apiKey = apiKey).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + + apiKey?.apply { request.putHeader("api_key", this.toString())} + + + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @JsonProperty(value = "available") available("available"), + @JsonProperty(value = "pending") pending("pending"), + @JsonProperty(value = "sold") sold("sold") + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + return findPetsByStatusWithHttpInfo(status = status).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/findByStatus")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + status.let { request.queryParams().add("status", toMultiValue(it.toList(), "csv")) } + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + suspend fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { + return findPetsByTagsWithHttpInfo(tags = tags).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/findByTags")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + tags.let { request.queryParams().add("tags", toMultiValue(it.toList(), "csv")) } + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getPetById(petId: kotlin.Long) : Pet { + return getPetByIdWithHttpInfo(petId = petId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun updatePet(pet: Pet) : Pet { + return updatePetWithHttpInfo(pet = pet).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun updatePetWithHttpInfo(pet: Pet) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.PUT, UriTemplate.of("$basePath/pet")) + + + + + request.putHeader("Content-Type", "application/json") + request.putHeader("Content-Type", "application/xml") + + request.putHeader("Accept", "application/xml, application/json") + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .sendBuffer(responseBody(pet)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null) : Unit { + return updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + request.putHeader("Content-Type", "application/x-www-form-urlencoded") + + + + + val form = io.vertx.core.MultiMap.caseInsensitiveMultiMap(); + name?.let { form.add("name", name) } + status?.let { form.add("status", status) } + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ModelApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null) : ModelApiResponse { + return uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet/{petId}/uploadImage".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + request.putHeader("Content-Type", "multipart/form-data") + + + request.putHeader("Accept", "application/json") + + val form = io.vertx.core.MultiMap.caseInsensitiveMultiMap(); + additionalMetadata?.let { form.add("additionalMetadata", additionalMetadata) } + file?.let { form.add("file", file.toString()) } + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.jacksonObjectMapper.writeValueAsBytes(body)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 00000000000..ed807c37aae --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,296 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.Order + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.type.TypeReference + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + +import io.vertx.kotlin.coroutines.await +import io.vertx.kotlin.coroutines.dispatcher +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class StoreApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun deleteOrder(orderId: kotlin.String) : Unit { + return deleteOrderWithHttpInfo(orderId = orderId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())))) + + + + + + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getInventory() : kotlin.collections.Map { + return getInventoryWithHttpInfo().map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getInventoryWithHttpInfo() : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/store/inventory")) + + + + + request.putHeader("Accept", "application/json") + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getOrderById(orderId: kotlin.Long) : Order { + return getOrderByIdWithHttpInfo(orderId = orderId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun placeOrder(order: Order) : Order { + return placeOrderWithHttpInfo(order = order).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun placeOrderWithHttpInfo(order: Order) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/store/order")) + + + + + request.putHeader("Content-Type", "application/json") + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .sendBuffer(responseBody(order)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.jacksonObjectMapper.writeValueAsBytes(body)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 00000000000..8d61918e1af --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,577 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.User + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.type.TypeReference + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + +import io.vertx.kotlin.coroutines.await +import io.vertx.kotlin.coroutines.dispatcher +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class UserApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun createUser(user: User) : Unit { + return createUserWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUserWithHttpInfo(user: User) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun createUsersWithArrayInput(user: kotlin.collections.List) : Unit { + return createUsersWithArrayInputWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUsersWithArrayInputWithHttpInfo(user: kotlin.collections.List) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user/createWithArray")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun createUsersWithListInput(user: kotlin.collections.List) : Unit { + return createUsersWithListInputWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUsersWithListInputWithHttpInfo(user: kotlin.collections.List) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user/createWithList")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun deleteUser(username: kotlin.String) : Unit { + return deleteUserWithHttpInfo(username = username).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun getUserByName(username: kotlin.String) : User { + return getUserByNameWithHttpInfo(username = username).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { + return loginUserWithHttpInfo(username = username, password = password).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/login")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + username.let { request.queryParams().add("username", listOf(it.toString())) } + password.let { request.queryParams().add("password", listOf(it.toString())) } + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Logs out current logged in user session + * + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun logoutUser() : Unit { + return logoutUserWithHttpInfo().map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Logs out current logged in user session + * + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun logoutUserWithHttpInfo() : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/logout")) + + + + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + suspend fun updateUser(username: kotlin.String, user: User) : Unit { + return updateUserWithHttpInfo(username = username, user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + }.await() + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun updateUserWithHttpInfo(username: kotlin.String, user: User) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.PUT, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.jacksonObjectMapper.writeValueAsBytes(body)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..ef7a8f1e1a6 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..ce6e66a1f31 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,86 @@ +package org.openapitools.client.infrastructure + +import io.vertx.core.Vertx +import io.vertx.core.buffer.Buffer +import java.nio.charset.StandardCharsets +import com.fasterxml.jackson.core.type.TypeReference + +open class ApiClient(val basePath: kotlin.String = defaultBasePath, val accessToken: String? = null, val apiKey: MutableMap = mutableMapOf(), val apiKeyPrefix: MutableMap = mutableMapOf(), var username: String? = null, var password: String? = null, val vertx: Vertx) { + companion object { + const val baseUrlKey = "org.openapitools.client.baseUrl" + + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") + } + } + + protected inline fun handleResponse(response: io.vertx.ext.web.client.HttpResponse): ApiResponse { + val code = response.statusCode() + val headers = response.headers().associate { it.key to listOf(it.value) } + val contentType = headers["Content-Type"]?.firstOrNull()?.substringBefore(";")?.lowercase(java.util.Locale.getDefault()) + + return when (code) { + in 100..199 -> Informational( + response.statusMessage(), + code, + headers + ) + in 200 .. 299 -> Success( + responseBody(response.body(), contentType), + code, + headers + ) + in 300..399 -> Redirection( + code, + headers + ) + in 400..499 -> ClientError( + response.statusMessage(), + response.bodyAsString(), + code, + headers + ) + else -> ServerError( + response.statusMessage(), + response.bodyAsString(), + code, + headers + ) + } + } + + protected inline fun responseBody(body: Buffer?, mediaType: String? = "application/json"): T? { + body ?: return null + + val bodyContent = String(body.bytes, StandardCharsets.UTF_8) + if (bodyContent.isEmpty()) { + return null + } + + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + protected fun encodeURIComponent(parameter: String): String { + return try { + java.net.URLEncoder.encode(parameter, java.nio.charset.StandardCharsets.UTF_8.name()) + } catch (e: java.io.UnsupportedEncodingException) { + parameter + } + } + + protected inline fun parseDateToQueryString(value : T): String { + /* + .replace("\"", "") converts the json object string to an actual string for the query parameter. + The moshi or gson adapter allows a more generic solution instead of trying to use a native + formatter. It also easily allows to provide a simple way to define a custom date format pattern + inside a gson/moshi adapter. + */ + return Serializer.jacksonObjectMapper.writeValueAsString(value).replace("\"", "") + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 00000000000..cf2cfaa95d9 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 00000000000..b5310e71f13 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,18 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..ece5c413e12 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,14 @@ +package org.openapitools.client.infrastructure + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.SerializationFeature +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper + +object Serializer { + @JvmStatic + val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper() + .findAndRegisterModules() + .setSerializationInclusion(JsonInclude.Include.NON_ABSENT) + .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..71a7d74b06f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,38 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * A category for a pet + * + * @param id + * @param name + */ + + +data class Category ( + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt new file mode 100644 index 00000000000..5590e88cd83 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -0,0 +1,42 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + + +data class ModelApiResponse ( + + @field:JsonProperty("code") + val code: kotlin.Int? = null, + + @field:JsonProperty("type") + val type: kotlin.String? = null, + + @field:JsonProperty("message") + val message: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 00000000000..94bc4e3be10 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,67 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * An order for a pets from the pet store + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + + +data class Order ( + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("petId") + val petId: kotlin.Long? = null, + + @field:JsonProperty("quantity") + val quantity: kotlin.Int? = null, + + @field:JsonProperty("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + + /* Order Status */ + @field:JsonProperty("status") + val status: Order.Status? = null, + + @field:JsonProperty("complete") + val complete: kotlin.Boolean? = false + +) { + + /** + * Order Status + * + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String) { + @JsonProperty(value = "placed") placed("placed"), + @JsonProperty(value = "approved") approved("approved"), + @JsonProperty(value = "delivered") delivered("delivered"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..2e5cefb83cd --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,70 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * A pet for sale in the pet store + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + + +data class Pet ( + + @field:JsonProperty("name") + val name: kotlin.String, + + @field:JsonProperty("photoUrls") + val photoUrls: kotlin.collections.List, + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("category") + val category: Category? = null, + + @field:JsonProperty("tags") + val tags: kotlin.collections.List? = null, + + /* pet status in the store */ + @field:JsonProperty("status") + @Deprecated(message = "This property is deprecated.") + val status: Pet.Status? = null + +) { + + /** + * pet status in the store + * + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String) { + @JsonProperty(value = "available") available("available"), + @JsonProperty(value = "pending") pending("pending"), + @JsonProperty(value = "sold") sold("sold"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..f5f600cc374 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,38 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * A tag for a pet + * + * @param id + * @param name + */ + + +data class Tag ( + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 00000000000..7872ed7da4d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,63 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * A User who is purchasing from the pet store + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + + +data class User ( + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("username") + val username: kotlin.String? = null, + + @field:JsonProperty("firstName") + val firstName: kotlin.String? = null, + + @field:JsonProperty("lastName") + val lastName: kotlin.String? = null, + + @field:JsonProperty("email") + val email: kotlin.String? = null, + + @field:JsonProperty("password") + val password: kotlin.String? = null, + + @field:JsonProperty("phone") + val phone: kotlin.String? = null, + + /* User Status */ + @field:JsonProperty("userStatus") + val userStatus: kotlin.Int? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/.openapi-generator-ignore b/samples/client/petstore/kotlin-jvm-vertx-jackson/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-vertx-jackson/.openapi-generator/FILES new file mode 100644 index 00000000000..b468a696e09 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/.openapi-generator/FILES @@ -0,0 +1,30 @@ +README.md +build.gradle +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 +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-vertx-jackson/.openapi-generator/VERSION new file mode 100644 index 00000000000..d6b4ec4aa78 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/README.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/README.md new file mode 100644 index 00000000000..e3f2108bfcd --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/README.md @@ -0,0 +1,99 @@ +# org.openapitools.client - Kotlin client library for 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. + +## 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.KotlinClientCodegen + +## Requires + +* Kotlin 1.6.10 +* Gradle 7.5 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle b/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle new file mode 100644 index 00000000000..b28c2542d79 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle @@ -0,0 +1,41 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '7.5' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.6.10' + ext.vertx_version = "4.3.3" + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.13.3" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.3" + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" + implementation "io.vertx:vertx-web-client:$vertx_version" + implementation "io.vertx:vertx-core:$vertx_version" + implementation "io.vertx:vertx-lang-kotlin:$vertx_version" + implementation "io.vertx:vertx-uri-template:$vertx_version" +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/ApiResponse.md new file mode 100644 index 00000000000..12f08d5cdef --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ModelApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Category.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Category.md new file mode 100644 index 00000000000..2c28a670fc7 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Order.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Order.md new file mode 100644 index 00000000000..94ab0d537e5 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#Status) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Pet.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Pet.md new file mode 100644 index 00000000000..bc3dd89718f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.collections.List<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#Status) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md new file mode 100644 index 00000000000..6962f148b59 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md @@ -0,0 +1,417 @@ +# 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** +> Pet addPet(pet) + +Add a new pet to the store + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + val result : Pet = apiInstance.addPet(pet) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.collections.List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter +try { + val result : kotlin.collections.List = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.collections.List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by +try { + val result : kotlin.collections.List = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> Pet updatePet(pet) + +Update an existing pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + val result : Pet = apiInstance.updatePet(pet) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md new file mode 100644 index 00000000000..68fbd1fecf9 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md @@ -0,0 +1,198 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Tag.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/User.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/User.md new file mode 100644 index 00000000000..e801729b5ed --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md new file mode 100644 index 00000000000..e674269be5e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md @@ -0,0 +1,404 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.collections.List = // kotlin.collections.List | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.collections.List = // kotlin.collections.List | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e708b1c023e Binary files /dev/null and b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..8cf6eb5ad22 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew new file mode 100644 index 00000000000..4f906e0c811 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat new file mode 100644 index 00000000000..107acd32c4e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/settings.gradle b/samples/client/petstore/kotlin-jvm-vertx-jackson/settings.gradle new file mode 100644 index 00000000000..555e588800d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-jvm-vertx' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 00000000000..00628ca7b1f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,591 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.ModelApiResponse +import org.openapitools.client.models.Pet + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.type.TypeReference + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class PetApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPet(pet: Pet) : Future { + return addPetWithHttpInfo(pet = pet).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun addPetWithHttpInfo(pet: Pet) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet")) + + + + + request.putHeader("Content-Type", "application/json") + request.putHeader("Content-Type", "application/xml") + + request.putHeader("Accept", "application/xml, application/json") + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .sendBuffer(responseBody(pet)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null) : Future { + return deletePetWithHttpInfo(petId = petId, apiKey = apiKey).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + + apiKey?.apply { request.putHeader("api_key", this.toString())} + + + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @JsonProperty(value = "available") available("available"), + @JsonProperty(value = "pending") pending("pending"), + @JsonProperty(value = "sold") sold("sold") + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatus(status: kotlin.collections.List) : Future> { + return findPetsByStatusWithHttpInfo(status = status).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/findByStatus")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + status.let { request.queryParams().add("status", toMultiValue(it.toList(), "csv")) } + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTags(tags: kotlin.collections.List) : Future> { + return findPetsByTagsWithHttpInfo(tags = tags).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/findByTags")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + tags.let { request.queryParams().add("tags", toMultiValue(it.toList(), "csv")) } + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetById(petId: kotlin.Long) : Future { + return getPetByIdWithHttpInfo(petId = petId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePet(pet: Pet) : Future { + return updatePetWithHttpInfo(pet = pet).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun updatePetWithHttpInfo(pet: Pet) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.PUT, UriTemplate.of("$basePath/pet")) + + + + + request.putHeader("Content-Type", "application/json") + request.putHeader("Content-Type", "application/xml") + + request.putHeader("Accept", "application/xml, application/json") + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .sendBuffer(responseBody(pet)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null) : Future { + return updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + request.putHeader("Content-Type", "application/x-www-form-urlencoded") + + + + + val form = io.vertx.core.MultiMap.caseInsensitiveMultiMap(); + name?.let { form.add("name", name) } + status?.let { form.add("status", status) } + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ModelApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null) : Future { + return uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet/{petId}/uploadImage".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + request.putHeader("Content-Type", "multipart/form-data") + + + request.putHeader("Accept", "application/json") + + val form = io.vertx.core.MultiMap.caseInsensitiveMultiMap(); + additionalMetadata?.let { form.add("additionalMetadata", additionalMetadata) } + file?.let { form.add("file", file.toString()) } + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.jacksonObjectMapper.writeValueAsBytes(body)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 00000000000..00640882ecd --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,292 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.Order + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.type.TypeReference + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class StoreApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrder(orderId: kotlin.String) : Future { + return deleteOrderWithHttpInfo(orderId = orderId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())))) + + + + + + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventory() : Future> { + return getInventoryWithHttpInfo().map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getInventoryWithHttpInfo() : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/store/inventory")) + + + + + request.putHeader("Accept", "application/json") + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderById(orderId: kotlin.Long) : Future { + return getOrderByIdWithHttpInfo(orderId = orderId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrder(order: Order) : Future { + return placeOrderWithHttpInfo(order = order).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun placeOrderWithHttpInfo(order: Order) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/store/order")) + + + + + request.putHeader("Content-Type", "application/json") + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .sendBuffer(responseBody(order)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.jacksonObjectMapper.writeValueAsBytes(body)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 00000000000..206ba4f7033 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,573 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.User + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.type.TypeReference + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class UserApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUser(user: User) : Future { + return createUserWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUserWithHttpInfo(user: User) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInput(user: kotlin.collections.List) : Future { + return createUsersWithArrayInputWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUsersWithArrayInputWithHttpInfo(user: kotlin.collections.List) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user/createWithArray")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInput(user: kotlin.collections.List) : Future { + return createUsersWithListInputWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUsersWithListInputWithHttpInfo(user: kotlin.collections.List) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user/createWithList")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUser(username: kotlin.String) : Future { + return deleteUserWithHttpInfo(username = username).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByName(username: kotlin.String) : Future { + return getUserByNameWithHttpInfo(username = username).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUser(username: kotlin.String, password: kotlin.String) : Future { + return loginUserWithHttpInfo(username = username, password = password).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/login")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + username.let { request.queryParams().add("username", listOf(it.toString())) } + password.let { request.queryParams().add("password", listOf(it.toString())) } + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Logs out current logged in user session + * + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUser() : Future { + return logoutUserWithHttpInfo().map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Logs out current logged in user session + * + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun logoutUserWithHttpInfo() : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/logout")) + + + + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUser(username: kotlin.String, user: User) : Future { + return updateUserWithHttpInfo(username = username, user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun updateUserWithHttpInfo(username: kotlin.String, user: User) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.PUT, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.jacksonObjectMapper.writeValueAsBytes(body)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..ef7a8f1e1a6 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..ce6e66a1f31 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,86 @@ +package org.openapitools.client.infrastructure + +import io.vertx.core.Vertx +import io.vertx.core.buffer.Buffer +import java.nio.charset.StandardCharsets +import com.fasterxml.jackson.core.type.TypeReference + +open class ApiClient(val basePath: kotlin.String = defaultBasePath, val accessToken: String? = null, val apiKey: MutableMap = mutableMapOf(), val apiKeyPrefix: MutableMap = mutableMapOf(), var username: String? = null, var password: String? = null, val vertx: Vertx) { + companion object { + const val baseUrlKey = "org.openapitools.client.baseUrl" + + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") + } + } + + protected inline fun handleResponse(response: io.vertx.ext.web.client.HttpResponse): ApiResponse { + val code = response.statusCode() + val headers = response.headers().associate { it.key to listOf(it.value) } + val contentType = headers["Content-Type"]?.firstOrNull()?.substringBefore(";")?.lowercase(java.util.Locale.getDefault()) + + return when (code) { + in 100..199 -> Informational( + response.statusMessage(), + code, + headers + ) + in 200 .. 299 -> Success( + responseBody(response.body(), contentType), + code, + headers + ) + in 300..399 -> Redirection( + code, + headers + ) + in 400..499 -> ClientError( + response.statusMessage(), + response.bodyAsString(), + code, + headers + ) + else -> ServerError( + response.statusMessage(), + response.bodyAsString(), + code, + headers + ) + } + } + + protected inline fun responseBody(body: Buffer?, mediaType: String? = "application/json"): T? { + body ?: return null + + val bodyContent = String(body.bytes, StandardCharsets.UTF_8) + if (bodyContent.isEmpty()) { + return null + } + + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + protected fun encodeURIComponent(parameter: String): String { + return try { + java.net.URLEncoder.encode(parameter, java.nio.charset.StandardCharsets.UTF_8.name()) + } catch (e: java.io.UnsupportedEncodingException) { + parameter + } + } + + protected inline fun parseDateToQueryString(value : T): String { + /* + .replace("\"", "") converts the json object string to an actual string for the query parameter. + The moshi or gson adapter allows a more generic solution instead of trying to use a native + formatter. It also easily allows to provide a simple way to define a custom date format pattern + inside a gson/moshi adapter. + */ + return Serializer.jacksonObjectMapper.writeValueAsString(value).replace("\"", "") + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 00000000000..cf2cfaa95d9 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 00000000000..b5310e71f13 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,18 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..ece5c413e12 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,14 @@ +package org.openapitools.client.infrastructure + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.SerializationFeature +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper + +object Serializer { + @JvmStatic + val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper() + .findAndRegisterModules() + .setSerializationInclusion(JsonInclude.Include.NON_ABSENT) + .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..71a7d74b06f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,38 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * A category for a pet + * + * @param id + * @param name + */ + + +data class Category ( + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt new file mode 100644 index 00000000000..5590e88cd83 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -0,0 +1,42 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + + +data class ModelApiResponse ( + + @field:JsonProperty("code") + val code: kotlin.Int? = null, + + @field:JsonProperty("type") + val type: kotlin.String? = null, + + @field:JsonProperty("message") + val message: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 00000000000..94bc4e3be10 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,67 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * An order for a pets from the pet store + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + + +data class Order ( + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("petId") + val petId: kotlin.Long? = null, + + @field:JsonProperty("quantity") + val quantity: kotlin.Int? = null, + + @field:JsonProperty("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + + /* Order Status */ + @field:JsonProperty("status") + val status: Order.Status? = null, + + @field:JsonProperty("complete") + val complete: kotlin.Boolean? = false + +) { + + /** + * Order Status + * + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String) { + @JsonProperty(value = "placed") placed("placed"), + @JsonProperty(value = "approved") approved("approved"), + @JsonProperty(value = "delivered") delivered("delivered"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..2e5cefb83cd --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,70 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * A pet for sale in the pet store + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + + +data class Pet ( + + @field:JsonProperty("name") + val name: kotlin.String, + + @field:JsonProperty("photoUrls") + val photoUrls: kotlin.collections.List, + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("category") + val category: Category? = null, + + @field:JsonProperty("tags") + val tags: kotlin.collections.List? = null, + + /* pet status in the store */ + @field:JsonProperty("status") + @Deprecated(message = "This property is deprecated.") + val status: Pet.Status? = null + +) { + + /** + * pet status in the store + * + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String) { + @JsonProperty(value = "available") available("available"), + @JsonProperty(value = "pending") pending("pending"), + @JsonProperty(value = "sold") sold("sold"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..f5f600cc374 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,38 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * A tag for a pet + * + * @param id + * @param name + */ + + +data class Tag ( + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 00000000000..7872ed7da4d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,63 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * A User who is purchasing from the pet store + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + + +data class User ( + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("username") + val username: kotlin.String? = null, + + @field:JsonProperty("firstName") + val firstName: kotlin.String? = null, + + @field:JsonProperty("lastName") + val lastName: kotlin.String? = null, + + @field:JsonProperty("email") + val email: kotlin.String? = null, + + @field:JsonProperty("password") + val password: kotlin.String? = null, + + @field:JsonProperty("phone") + val phone: kotlin.String? = null, + + /* User Status */ + @field:JsonProperty("userStatus") + val userStatus: kotlin.Int? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/.openapi-generator-ignore b/samples/client/petstore/kotlin-jvm-vertx-moshi/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-vertx-moshi/.openapi-generator/FILES new file mode 100644 index 00000000000..d3014d6b9bb --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/.openapi-generator/FILES @@ -0,0 +1,38 @@ +README.md +build.gradle +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 +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-vertx-moshi/.openapi-generator/VERSION new file mode 100644 index 00000000000..d6b4ec4aa78 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/README.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/README.md new file mode 100644 index 00000000000..e3f2108bfcd --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/README.md @@ -0,0 +1,99 @@ +# org.openapitools.client - Kotlin client library for 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. + +## 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.KotlinClientCodegen + +## Requires + +* Kotlin 1.6.10 +* Gradle 7.5 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/build.gradle b/samples/client/petstore/kotlin-jvm-vertx-moshi/build.gradle new file mode 100644 index 00000000000..ec3e077d419 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/build.gradle @@ -0,0 +1,41 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '7.5' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.6.10' + ext.vertx_version = "4.3.3" + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + implementation "com.squareup.moshi:moshi-kotlin:1.13.0" + implementation "com.squareup.moshi:moshi-adapters:1.13.0" + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" + implementation "io.vertx:vertx-web-client:$vertx_version" + implementation "io.vertx:vertx-core:$vertx_version" + implementation "io.vertx:vertx-lang-kotlin:$vertx_version" + implementation "io.vertx:vertx-uri-template:$vertx_version" +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/ApiResponse.md new file mode 100644 index 00000000000..12f08d5cdef --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ModelApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Category.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Category.md new file mode 100644 index 00000000000..2c28a670fc7 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Order.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Order.md new file mode 100644 index 00000000000..94ab0d537e5 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#Status) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Pet.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Pet.md new file mode 100644 index 00000000000..bc3dd89718f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.collections.List<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#Status) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md new file mode 100644 index 00000000000..6962f148b59 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md @@ -0,0 +1,417 @@ +# 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** +> Pet addPet(pet) + +Add a new pet to the store + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + val result : Pet = apiInstance.addPet(pet) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.collections.List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter +try { + val result : kotlin.collections.List = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.collections.List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by +try { + val result : kotlin.collections.List = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> Pet updatePet(pet) + +Update an existing pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + val result : Pet = apiInstance.updatePet(pet) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md new file mode 100644 index 00000000000..68fbd1fecf9 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md @@ -0,0 +1,198 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Tag.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/User.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/User.md new file mode 100644 index 00000000000..e801729b5ed --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md new file mode 100644 index 00000000000..e674269be5e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md @@ -0,0 +1,404 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.collections.List = // kotlin.collections.List | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.collections.List = // kotlin.collections.List | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e708b1c023e Binary files /dev/null and b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..8cf6eb5ad22 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew new file mode 100644 index 00000000000..4f906e0c811 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat new file mode 100644 index 00000000000..107acd32c4e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/settings.gradle b/samples/client/petstore/kotlin-jvm-vertx-moshi/settings.gradle new file mode 100644 index 00000000000..555e588800d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-jvm-vertx' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 00000000000..63930955352 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,590 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.ModelApiResponse +import org.openapitools.client.models.Pet + +import com.squareup.moshi.Json + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class PetApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun addPet(pet: Pet) : Future { + return addPetWithHttpInfo(pet = pet).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun addPetWithHttpInfo(pet: Pet) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet")) + + + + + request.putHeader("Content-Type", "application/json") + request.putHeader("Content-Type", "application/xml") + + request.putHeader("Accept", "application/xml, application/json") + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .sendBuffer(responseBody(pet)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null) : Future { + return deletePetWithHttpInfo(petId = petId, apiKey = apiKey).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + + apiKey?.apply { request.putHeader("api_key", this.toString())} + + + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold") + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun findPetsByStatus(status: kotlin.collections.List) : Future> { + return findPetsByStatusWithHttpInfo(status = status).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/findByStatus")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + status.let { request.queryParams().add("status", toMultiValue(it.toList(), "csv")) } + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTags(tags: kotlin.collections.List) : Future> { + return findPetsByTagsWithHttpInfo(tags = tags).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + @Deprecated(message = "This operation is deprecated.") + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/findByTags")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + tags.let { request.queryParams().add("tags", toMultiValue(it.toList(), "csv")) } + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getPetById(petId: kotlin.Long) : Future { + return getPetByIdWithHttpInfo(petId = petId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePet(pet: Pet) : Future { + return updatePetWithHttpInfo(pet = pet).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun updatePetWithHttpInfo(pet: Pet) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.PUT, UriTemplate.of("$basePath/pet")) + + + + + request.putHeader("Content-Type", "application/json") + request.putHeader("Content-Type", "application/xml") + + request.putHeader("Accept", "application/xml, application/json") + + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .sendBuffer(responseBody(pet)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null) : Future { + return updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + request.putHeader("Content-Type", "application/x-www-form-urlencoded") + + + + + val form = io.vertx.core.MultiMap.caseInsensitiveMultiMap(); + name?.let { form.add("name", name) } + status?.let { form.add("status", status) } + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ModelApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null) : Future { + return uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/pet/{petId}/uploadImage".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())))) + + request.putHeader("Content-Type", "multipart/form-data") + + + request.putHeader("Accept", "application/json") + + val form = io.vertx.core.MultiMap.caseInsensitiveMultiMap(); + additionalMetadata?.let { form.add("additionalMetadata", additionalMetadata) } + file?.let { form.add("file", file.toString()) } + + + accessToken?.let { accessToken -> + request.bearerTokenAuthentication(accessToken) + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.moshi.adapter(T::class.java).toJson(body)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 00000000000..451a1adb48f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,291 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.Order + +import com.squareup.moshi.Json + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class StoreApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteOrder(orderId: kotlin.String) : Future { + return deleteOrderWithHttpInfo(orderId = orderId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())))) + + + + + + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getInventory() : Future> { + return getInventoryWithHttpInfo().map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiResponse?> + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getInventoryWithHttpInfo() : Future?>> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/store/inventory")) + + + + + request.putHeader("Accept", "application/json") + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse?> = handleResponse(it) + apiResponse + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getOrderById(orderId: kotlin.Long) : Future { + return getOrderByIdWithHttpInfo(orderId = orderId).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun placeOrder(order: Order) : Future { + return placeOrderWithHttpInfo(order = order).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun placeOrderWithHttpInfo(order: Order) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/store/order")) + + + + + request.putHeader("Content-Type", "application/json") + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .sendBuffer(responseBody(order)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.moshi.adapter(T::class.java).toJson(body)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 00000000000..3c367b1fa05 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,572 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import java.io.IOException + +import org.openapitools.client.models.User + +import com.squareup.moshi.Json + +import io.vertx.core.Vertx +import io.vertx.core.http.RequestOptions +import io.vertx.core.http.HttpMethod +import io.vertx.core.buffer.Buffer +import io.vertx.core.Future +import io.vertx.ext.web.client.WebClient +import io.vertx.uritemplate.UriTemplate + + +import org.openapitools.client.infrastructure.* + +@Suppress ("UNUSED") +class UserApi(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) { + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUser(user: User) : Future { + return createUserWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUserWithHttpInfo(user: User) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithArrayInput(user: kotlin.collections.List) : Future { + return createUsersWithArrayInputWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUsersWithArrayInputWithHttpInfo(user: kotlin.collections.List) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user/createWithArray")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun createUsersWithListInput(user: kotlin.collections.List) : Future { + return createUsersWithListInputWithHttpInfo(user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Creates list of users with given input array + * + * @param user List of user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun createUsersWithListInputWithHttpInfo(user: kotlin.collections.List) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.POST, UriTemplate.of("$basePath/user/createWithList")) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun deleteUser(username: kotlin.String) : Future { + return deleteUserWithHttpInfo(username = username).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun deleteUserWithHttpInfo(username: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.DELETE, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun getUserByName(username: kotlin.String) : Future { + return getUserByNameWithHttpInfo(username = username).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun getUserByNameWithHttpInfo(username: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun loginUser(username: kotlin.String, password: kotlin.String) : Future { + return loginUserWithHttpInfo(username = username, password = password).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/login")) + + + + + request.putHeader("Accept", "application/xml, application/json") + + + username.let { request.queryParams().add("username", listOf(it.toString())) } + password.let { request.queryParams().add("password", listOf(it.toString())) } + + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Logs out current logged in user session + * + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun logoutUser() : Future { + return logoutUserWithHttpInfo().map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Logs out current logged in user session + * + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun logoutUserWithHttpInfo() : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.GET, UriTemplate.of("$basePath/user/logout")) + + + + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .send() + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun updateUser(username: kotlin.String, user: User) : Future { + return updateUserWithHttpInfo(username = username, user = user).map { localVarResponse -> + when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param user Updated user object + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Throws(IllegalStateException::class, IOException::class) + fun updateUserWithHttpInfo(username: kotlin.String, user: User) : Future> { + val vertxClient = WebClient.create(vertx) + val request = vertxClient.requestAbs(HttpMethod.PUT, UriTemplate.of("$basePath/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())))) + + + + + request.putHeader("Content-Type", "application/json") + + + + + + if (apiKey["api_key"] != null) { + if (apiKeyPrefix["api_key"] != null) { + request.putHeader("api_key", apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!!) + } else { + request.putHeader("api_key", apiKey["api_key"]!!) + } + } + + return request + .sendBuffer(responseBody(user)) + .map { + val apiResponse: ApiResponse = handleResponse(it) + apiResponse + } + } + + + private inline fun responseBody(body: T): Buffer { + return Buffer.buffer(Serializer.moshi.adapter(T::class.java).toJson(body)) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..ef7a8f1e1a6 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..ec5e0ac095e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,85 @@ +package org.openapitools.client.infrastructure + +import io.vertx.core.Vertx +import io.vertx.core.buffer.Buffer +import java.nio.charset.StandardCharsets + +open class ApiClient(val basePath: kotlin.String = defaultBasePath, val accessToken: String? = null, val apiKey: MutableMap = mutableMapOf(), val apiKeyPrefix: MutableMap = mutableMapOf(), var username: String? = null, var password: String? = null, val vertx: Vertx) { + companion object { + const val baseUrlKey = "org.openapitools.client.baseUrl" + + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") + } + } + + protected inline fun handleResponse(response: io.vertx.ext.web.client.HttpResponse): ApiResponse { + val code = response.statusCode() + val headers = response.headers().associate { it.key to listOf(it.value) } + val contentType = headers["Content-Type"]?.firstOrNull()?.substringBefore(";")?.lowercase(java.util.Locale.getDefault()) + + return when (code) { + in 100..199 -> Informational( + response.statusMessage(), + code, + headers + ) + in 200 .. 299 -> Success( + responseBody(response.body(), contentType), + code, + headers + ) + in 300..399 -> Redirection( + code, + headers + ) + in 400..499 -> ClientError( + response.statusMessage(), + response.bodyAsString(), + code, + headers + ) + else -> ServerError( + response.statusMessage(), + response.bodyAsString(), + code, + headers + ) + } + } + + protected inline fun responseBody(body: Buffer?, mediaType: String? = "application/json"): T? { + body ?: return null + + val bodyContent = String(body.bytes, StandardCharsets.UTF_8) + if (bodyContent.isEmpty()) { + return null + } + + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) + else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") + } + } + + protected fun encodeURIComponent(parameter: String): String { + return try { + java.net.URLEncoder.encode(parameter, java.nio.charset.StandardCharsets.UTF_8.name()) + } catch (e: java.io.UnsupportedEncodingException) { + parameter + } + } + + protected inline fun parseDateToQueryString(value : T): String { + /* + .replace("\"", "") converts the json object string to an actual string for the query parameter. + The moshi or gson adapter allows a more generic solution instead of trying to use a native + formatter. It also easily allows to provide a simple way to define a custom date format pattern + inside a gson/moshi adapter. + */ + return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 00000000000..cf2cfaa95d9 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt new file mode 100644 index 00000000000..064b57fc6b8 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.math.BigDecimal + +class BigDecimalAdapter { + @ToJson + fun toJson(value: BigDecimal): String { + return value.toPlainString() + } + + @FromJson + fun fromJson(value: String): BigDecimal { + return BigDecimal(value) + } +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt new file mode 100644 index 00000000000..7df6057b450 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.math.BigInteger + +class BigIntegerAdapter { + @ToJson + fun toJson(value: BigInteger): String { + return value.toString() + } + + @FromJson + fun fromJson(value: String): BigInteger { + return BigInteger(value) + } +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 00000000000..ff5e2a81ee8 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,12 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson + +class ByteArrayAdapter { + @ToJson + fun toJson(data: ByteArray): String = String(data) + + @FromJson + fun fromJson(data: String): ByteArray = data.toByteArray() +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt new file mode 100644 index 00000000000..b5310e71f13 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -0,0 +1,18 @@ +@file:Suppress("unused") +package org.openapitools.client.infrastructure + +import java.lang.RuntimeException + +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 123L + } +} + +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { + + companion object { + private const val serialVersionUID: Long = 456L + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 00000000000..b2e1654479a --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter { + @ToJson + fun toJson(value: LocalDate): String { + return DateTimeFormatter.ISO_LOCAL_DATE.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDate { + return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 00000000000..e082db94811 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter { + @ToJson + fun toJson(value: LocalDateTime): String { + return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): LocalDateTime { + return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 00000000000..87437871a31 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter { + @ToJson + fun toJson(value: OffsetDateTime): String { + return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): OffsetDateTime { + return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) + } + +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..e22592e47d7 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory + +object Serializer { + @JvmStatic + val moshiBuilder: Moshi.Builder = Moshi.Builder() + .add(OffsetDateTimeAdapter()) + .add(LocalDateTimeAdapter()) + .add(LocalDateAdapter()) + .add(UUIDAdapter()) + .add(ByteArrayAdapter()) + .add(URIAdapter()) + .add(KotlinJsonAdapterFactory()) + .add(BigDecimalAdapter()) + .add(BigIntegerAdapter()) + + @JvmStatic + val moshi: Moshi by lazy { + moshiBuilder.build() + } +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt new file mode 100644 index 00000000000..927522757da --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.net.URI + +class URIAdapter { + @ToJson + fun toJson(uri: URI) = uri.toString() + + @FromJson + fun fromJson(s: String): URI = URI.create(s) +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 00000000000..7ccf7dc25d2 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.util.UUID + +class UUIDAdapter { + @ToJson + fun toJson(uuid: UUID) = uuid.toString() + + @FromJson + fun fromJson(s: String): UUID = UUID.fromString(s) +} diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..0ff54370cba --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,38 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json + +/** + * A category for a pet + * + * @param id + * @param name + */ + + +data class Category ( + + @Json(name = "id") + val id: kotlin.Long? = null, + + @Json(name = "name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt new file mode 100644 index 00000000000..38be7b7ae1a --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -0,0 +1,42 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + + +data class ModelApiResponse ( + + @Json(name = "code") + val code: kotlin.Int? = null, + + @Json(name = "type") + val type: kotlin.String? = null, + + @Json(name = "message") + val message: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 00000000000..b205115e886 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,67 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json + +/** + * An order for a pets from the pet store + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + + +data class Order ( + + @Json(name = "id") + val id: kotlin.Long? = null, + + @Json(name = "petId") + val petId: kotlin.Long? = null, + + @Json(name = "quantity") + val quantity: kotlin.Int? = null, + + @Json(name = "shipDate") + val shipDate: java.time.OffsetDateTime? = null, + + /* Order Status */ + @Json(name = "status") + val status: Order.Status? = null, + + @Json(name = "complete") + val complete: kotlin.Boolean? = false + +) { + + /** + * Order Status + * + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String) { + @Json(name = "placed") placed("placed"), + @Json(name = "approved") approved("approved"), + @Json(name = "delivered") delivered("delivered"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..46ba1951a02 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,70 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.squareup.moshi.Json + +/** + * A pet for sale in the pet store + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + + +data class Pet ( + + @Json(name = "name") + val name: kotlin.String, + + @Json(name = "photoUrls") + val photoUrls: kotlin.collections.List, + + @Json(name = "id") + val id: kotlin.Long? = null, + + @Json(name = "category") + val category: Category? = null, + + @Json(name = "tags") + val tags: kotlin.collections.List? = null, + + /* pet status in the store */ + @Json(name = "status") + @Deprecated(message = "This property is deprecated.") + val status: Pet.Status? = null + +) { + + /** + * pet status in the store + * + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..3c0b4e04c7a --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,38 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json + +/** + * A tag for a pet + * + * @param id + * @param name + */ + + +data class Tag ( + + @Json(name = "id") + val id: kotlin.Long? = null, + + @Json(name = "name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 00000000000..e8e30f3c394 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,63 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json + +/** + * A User who is purchasing from the pet store + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + + +data class User ( + + @Json(name = "id") + val id: kotlin.Long? = null, + + @Json(name = "username") + val username: kotlin.String? = null, + + @Json(name = "firstName") + val firstName: kotlin.String? = null, + + @Json(name = "lastName") + val lastName: kotlin.String? = null, + + @Json(name = "email") + val email: kotlin.String? = null, + + @Json(name = "password") + val password: kotlin.String? = null, + + @Json(name = "phone") + val phone: kotlin.String? = null, + + /* User Status */ + @Json(name = "userStatus") + val userStatus: kotlin.Int? = null + +) + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt index c1dcccb58b7..affc2b522f7 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt @@ -27,6 +27,7 @@ import org.openapitools.client.infrastructure.ITransformForStorage * @param name */ + data class Category ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt index 625e71c9d8c..f5ac0753e58 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt @@ -28,6 +28,7 @@ import org.openapitools.client.infrastructure.ITransformForStorage * @param message */ + data class ModelApiResponse ( @SerializedName("code") diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt index a2e6db7f0f3..608ac750337 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt @@ -31,6 +31,7 @@ import org.openapitools.client.infrastructure.ITransformForStorage * @param complete */ + data class Order ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt index 03997335052..191dd5d0283 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt @@ -33,6 +33,7 @@ import org.openapitools.client.infrastructure.ITransformForStorage * @param status pet status in the store */ + data class Pet ( @SerializedName("name") diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt index 206ba2eb223..f32788176b8 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt @@ -27,6 +27,7 @@ import org.openapitools.client.infrastructure.ITransformForStorage * @param name */ + data class Tag ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt index a0d3ee53723..a18aceca9b2 100644 --- a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt @@ -33,6 +33,7 @@ import org.openapitools.client.infrastructure.ITransformForStorage * @param userStatus User Status */ + data class User ( @SerializedName("id") diff --git a/samples/client/petstore/kotlin-modelMutable/README.md b/samples/client/petstore/kotlin-modelMutable/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-modelMutable/README.md +++ b/samples/client/petstore/kotlin-modelMutable/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Category.kt index a1bee507cc6..1706aa826c5 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + data class Category ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 7869a815851..977eebbf018 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -26,6 +26,7 @@ import com.squareup.moshi.Json * @param message */ + data class ModelApiResponse ( @Json(name = "code") diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Order.kt index 75d6dc52fa7..61bb63c238a 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -29,6 +29,7 @@ import com.squareup.moshi.Json * @param complete */ + data class Order ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Pet.kt index 9bace47c424..1fb3eed12ed 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param status pet status in the store */ + data class Pet ( @Json(name = "name") diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Tag.kt index d52e127012a..b327508b80d 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + data class Tag ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/User.kt index 5c871725685..1ed3a745e9f 100644 --- a/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-modelMutable/src/main/kotlin/org/openapitools/client/models/User.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param userStatus User Status */ + data class User ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-moshi-codegen/README.md b/samples/client/petstore/kotlin-moshi-codegen/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/README.md +++ b/samples/client/petstore/kotlin-moshi-codegen/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt index 3d1ca0a7f25..27d48282053 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -26,6 +26,7 @@ import com.squareup.moshi.JsonClass * @param name */ @JsonClass(generateAdapter = true) + data class Category ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 0fbbf5e5e06..c4db7ae9fe4 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -27,6 +27,7 @@ import com.squareup.moshi.JsonClass * @param message */ @JsonClass(generateAdapter = true) + data class ModelApiResponse ( @Json(name = "code") diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt index b2d33f85be3..c5f80932fff 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -30,6 +30,7 @@ import com.squareup.moshi.JsonClass * @param complete */ @JsonClass(generateAdapter = true) + data class Order ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt index f7f118762e8..7d31f52e5cb 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -32,6 +32,7 @@ import com.squareup.moshi.JsonClass * @param status pet status in the store */ @JsonClass(generateAdapter = true) + data class Pet ( @Json(name = "name") diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt index b62aca125b8..5f956d87780 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -26,6 +26,7 @@ import com.squareup.moshi.JsonClass * @param name */ @JsonClass(generateAdapter = true) + data class Tag ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt index 709983e041a..3e79d4fa60b 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt @@ -32,6 +32,7 @@ import com.squareup.moshi.JsonClass * @param userStatus User Status */ @JsonClass(generateAdapter = true) + data class User ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index dc660734191..35e549b9829 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -4,13 +4,13 @@ import io.ktor.client.HttpClient import io.ktor.client.HttpClientConfig import io.ktor.client.engine.HttpClientEngine import io.ktor.client.plugins.contentnegotiation.ContentNegotiation -import io.ktor.serialization.kotlinx.json.* import io.ktor.client.request.* import io.ktor.client.request.forms.FormDataContent import io.ktor.client.request.forms.MultiPartFormDataContent import io.ktor.client.request.header import io.ktor.client.request.parameter import io.ktor.client.statement.HttpResponse +import io.ktor.serialization.kotlinx.json.json import io.ktor.http.* import io.ktor.http.content.PartData import kotlin.Unit @@ -146,9 +146,9 @@ open class ApiClient( } this.method = requestConfig.method.httpMethod headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } - if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { this.setBody(body) - + } } } diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt index cadfa02396d..2e16584b4e4 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt @@ -27,6 +27,7 @@ import kotlinx.serialization.encoding.* * @param name */ @Serializable + data class Category ( @SerialName(value = "id") val id: kotlin.Long? = null, diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt index babd717df44..c9c0a490824 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -28,6 +28,7 @@ import kotlinx.serialization.encoding.* * @param message */ @Serializable + data class ModelApiResponse ( @SerialName(value = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt index 1fb838bc809..0af1287f077 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt @@ -31,6 +31,7 @@ import kotlinx.serialization.encoding.* * @param complete */ @Serializable + data class Order ( @SerialName(value = "id") val id: kotlin.Long? = null, diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt index e9768bd013d..a275dec03d7 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt @@ -33,6 +33,7 @@ import kotlinx.serialization.encoding.* * @param status pet status in the store */ @Serializable + data class Pet ( @SerialName(value = "name") @Required val name: kotlin.String, diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt index d7edf1d61e9..1bfe2f85978 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt @@ -27,6 +27,7 @@ import kotlinx.serialization.encoding.* * @param name */ @Serializable + data class Tag ( @SerialName(value = "id") val id: kotlin.Long? = null, diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt index 346113de5d5..29413ad2b02 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt @@ -33,6 +33,7 @@ import kotlinx.serialization.encoding.* * @param userStatus User Status */ @Serializable + data class User ( @SerialName(value = "id") val id: kotlin.Long? = null, diff --git a/samples/client/petstore/kotlin-nonpublic/README.md b/samples/client/petstore/kotlin-nonpublic/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-nonpublic/README.md +++ b/samples/client/petstore/kotlin-nonpublic/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt index e6743cfe80c..0bc27aeeeac 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + internal data class Category ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 14658f3824a..240217c5038 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -26,6 +26,7 @@ import com.squareup.moshi.Json * @param message */ + internal data class ModelApiResponse ( @Json(name = "code") diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt index 7e42b1669ca..e73667136dc 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -29,6 +29,7 @@ import com.squareup.moshi.Json * @param complete */ + internal data class Order ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt index fd644dee52f..a213f2a0434 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param status pet status in the store */ + internal data class Pet ( @Json(name = "name") diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt index c5533711021..5adffe2fa93 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + internal data class Tag ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt index 7cf94574051..8a9bebb6c2a 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param userStatus User Status */ + internal data class User ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-nullable/README.md b/samples/client/petstore/kotlin-nullable/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-nullable/README.md +++ b/samples/client/petstore/kotlin-nullable/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt index 7be2ec5ed23..f55a19bd9ca 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param name */ + data class Category ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 109f5f8ad99..5726e9692ca 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -27,6 +27,7 @@ import java.io.Serializable * @param message */ + data class ModelApiResponse ( @Json(name = "code") diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt index 959bb76bc51..3397ca42c82 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -30,6 +30,7 @@ import java.io.Serializable * @param complete */ + data class Order ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt index 8e8fa881d3c..11b45cbe3f9 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -32,6 +32,7 @@ import java.io.Serializable * @param status pet status in the store */ + data class Pet ( @Json(name = "name") diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt index 41d984658af..690006d55b8 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param name */ + data class Tag ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt index 92e10c741ec..7767cb15a24 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt @@ -32,6 +32,7 @@ import java.io.Serializable * @param userStatus User Status */ + data class User ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-okhttp3/README.md b/samples/client/petstore/kotlin-okhttp3/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-okhttp3/README.md +++ b/samples/client/petstore/kotlin-okhttp3/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt index 36beb0e657d..0ff54370cba 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + data class Category ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d9540485eb0..38be7b7ae1a 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -26,6 +26,7 @@ import com.squareup.moshi.Json * @param message */ + data class ModelApiResponse ( @Json(name = "code") diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt index bde4a0e9ac4..180deb9b31e 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -29,6 +29,7 @@ import com.squareup.moshi.Json * @param complete */ + data class Order ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt index ceaf28a7420..312a8476a24 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param status pet status in the store */ + data class Pet ( @Json(name = "name") diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt index 2086c90cfb4..3c0b4e04c7a 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + data class Tag ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt index 4ea236d7ca2..e8e30f3c394 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param userStatus User Status */ + data class User ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md index 1bd530b8996..473c874b300 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt index d76243ae684..8679742a9c0 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -28,6 +28,7 @@ import java.io.Serializable * @param name */ @KSerializable + data class Category ( @SerialName(value = "id") diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 3a1cb58e829..e2eb431d005 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -29,6 +29,7 @@ import java.io.Serializable * @param message */ @KSerializable + data class ModelApiResponse ( @SerialName(value = "code") diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt index 52a7d8b4738..fe9a5675934 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -32,6 +32,7 @@ import java.io.Serializable * @param complete */ @KSerializable + data class Order ( @SerialName(value = "id") diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt index b0564bd04c8..5a6276ac25f 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -34,6 +34,7 @@ import java.io.Serializable * @param status pet status in the store */ @KSerializable + data class Pet ( @SerialName(value = "name") diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt index b38f0f9adc8..c88920f6fd6 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -28,6 +28,7 @@ import java.io.Serializable * @param name */ @KSerializable + data class Tag ( @SerialName(value = "id") diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt index 0b84f270fbb..e9798c88637 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/User.kt @@ -34,6 +34,7 @@ import java.io.Serializable * @param userStatus User Status */ @KSerializable + data class User ( @SerialName(value = "id") diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/README.md b/samples/client/petstore/kotlin-retrofit2-rx3/README.md index 1bd530b8996..473c874b300 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/README.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Category.kt index 36beb0e657d..0ff54370cba 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + data class Category ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d9540485eb0..38be7b7ae1a 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -26,6 +26,7 @@ import com.squareup.moshi.Json * @param message */ + data class ModelApiResponse ( @Json(name = "code") diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Order.kt index d1de6588ca0..b205115e886 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -29,6 +29,7 @@ import com.squareup.moshi.Json * @param complete */ + data class Order ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Pet.kt index b1d4ea6bf0f..65203c615ba 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param status pet status in the store */ + data class Pet ( @Json(name = "name") diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Tag.kt index 2086c90cfb4..3c0b4e04c7a 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + data class Tag ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/User.kt index 4ea236d7ca2..e8e30f3c394 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/User.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param userStatus User Status */ + data class User ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-retrofit2/README.md b/samples/client/petstore/kotlin-retrofit2/README.md index 1bd530b8996..473c874b300 100644 --- a/samples/client/petstore/kotlin-retrofit2/README.md +++ b/samples/client/petstore/kotlin-retrofit2/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt index 36beb0e657d..0ff54370cba 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + data class Category ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d9540485eb0..38be7b7ae1a 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -26,6 +26,7 @@ import com.squareup.moshi.Json * @param message */ + data class ModelApiResponse ( @Json(name = "code") diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt index d1de6588ca0..b205115e886 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -29,6 +29,7 @@ import com.squareup.moshi.Json * @param complete */ + data class Order ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt index b1d4ea6bf0f..65203c615ba 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param status pet status in the store */ + data class Pet ( @Json(name = "name") diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt index 2086c90cfb4..3c0b4e04c7a 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + data class Tag ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt index 4ea236d7ca2..e8e30f3c394 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param userStatus User Status */ + data class User ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-string/README.md b/samples/client/petstore/kotlin-string/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-string/README.md +++ b/samples/client/petstore/kotlin-string/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt index 7be2ec5ed23..f55a19bd9ca 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param name */ + data class Category ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 109f5f8ad99..5726e9692ca 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -27,6 +27,7 @@ import java.io.Serializable * @param message */ + data class ModelApiResponse ( @Json(name = "code") diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt index a8d20ae5db6..5fe761492ba 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -30,6 +30,7 @@ import java.io.Serializable * @param complete */ + data class Order ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt index 9db9ee6739d..52a4711fe87 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -32,6 +32,7 @@ import java.io.Serializable * @param status pet status in the store */ + data class Pet ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt index 41d984658af..690006d55b8 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param name */ + data class Tag ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt index 92e10c741ec..7767cb15a24 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt @@ -32,6 +32,7 @@ import java.io.Serializable * @param userStatus User Status */ + data class User ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-threetenbp/README.md b/samples/client/petstore/kotlin-threetenbp/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin-threetenbp/README.md +++ b/samples/client/petstore/kotlin-threetenbp/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt index 36beb0e657d..0ff54370cba 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + data class Category ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d9540485eb0..38be7b7ae1a 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -26,6 +26,7 @@ import com.squareup.moshi.Json * @param message */ + data class ModelApiResponse ( @Json(name = "code") diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt index fece9ea4f6c..541ff81e0ab 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -29,6 +29,7 @@ import com.squareup.moshi.Json * @param complete */ + data class Order ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt index b1d4ea6bf0f..65203c615ba 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param status pet status in the store */ + data class Pet ( @Json(name = "name") diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt index 2086c90cfb4..3c0b4e04c7a 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,6 +25,7 @@ import com.squareup.moshi.Json * @param name */ + data class Tag ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt index 4ea236d7ca2..e8e30f3c394 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt @@ -31,6 +31,7 @@ import com.squareup.moshi.Json * @param userStatus User Status */ + data class User ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin-uppercase-enum/README.md b/samples/client/petstore/kotlin-uppercase-enum/README.md index 9b3bfe4e89e..40a6b5fa1ab 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/README.md +++ b/samples/client/petstore/kotlin-uppercase-enum/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin/README.md b/samples/client/petstore/kotlin/README.md index e8336e9f36b..e3f2108bfcd 100644 --- a/samples/client/petstore/kotlin/README.md +++ b/samples/client/petstore/kotlin/README.md @@ -11,8 +11,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat ## Requires -* Kotlin 1.4.30 -* Gradle 6.8.3 +* Kotlin 1.6.10 +* Gradle 7.5 ## Build diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index 7be2ec5ed23..f55a19bd9ca 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param name */ + data class Category ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 109f5f8ad99..5726e9692ca 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -27,6 +27,7 @@ import java.io.Serializable * @param message */ + data class ModelApiResponse ( @Json(name = "code") diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index 959bb76bc51..3397ca42c82 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -30,6 +30,7 @@ import java.io.Serializable * @param complete */ + data class Order ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index 8e8fa881d3c..11b45cbe3f9 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -32,6 +32,7 @@ import java.io.Serializable * @param status pet status in the store */ + data class Pet ( @Json(name = "name") diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index 41d984658af..690006d55b8 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -26,6 +26,7 @@ import java.io.Serializable * @param name */ + data class Tag ( @Json(name = "id") diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index 92e10c741ec..7767cb15a24 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -32,6 +32,7 @@ import java.io.Serializable * @param userStatus User Status */ + data class User ( @Json(name = "id") diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 527bbb0b015..ef354a7644b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -69,7 +69,14 @@ class AnotherFakeApi */ protected $hostIndex; - /** + /** @var string[] $contentTypes **/ + public const contentTypes = [ + 'call123TestSpecialTags' => [ + 'application/json', + ], + ]; + +/** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -121,14 +128,15 @@ class AnotherFakeApi * To test special tags * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['call123TestSpecialTags'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Client */ - public function call123TestSpecialTags($client) + public function call123TestSpecialTags($client, string $contentType = self::contentTypes['call123TestSpecialTags'][0]) { - list($response) = $this->call123TestSpecialTagsWithHttpInfo($client); + list($response) = $this->call123TestSpecialTagsWithHttpInfo($client, $contentType); return $response; } @@ -138,14 +146,15 @@ class AnotherFakeApi * To test special tags * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['call123TestSpecialTags'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ - public function call123TestSpecialTagsWithHttpInfo($client) + public function call123TestSpecialTagsWithHttpInfo($client, string $contentType = self::contentTypes['call123TestSpecialTags'][0]) { - $request = $this->call123TestSpecialTagsRequest($client); + $request = $this->call123TestSpecialTagsRequest($client, $contentType); try { $options = $this->createHttpClientOption(); @@ -183,7 +192,6 @@ class AnotherFakeApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -199,7 +207,6 @@ class AnotherFakeApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = '\OpenAPI\Client\Model\Client'; @@ -220,7 +227,6 @@ class AnotherFakeApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -229,7 +235,6 @@ class AnotherFakeApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -241,13 +246,14 @@ class AnotherFakeApi * To test special tags * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['call123TestSpecialTags'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function call123TestSpecialTagsAsync($client) + public function call123TestSpecialTagsAsync($client, string $contentType = self::contentTypes['call123TestSpecialTags'][0]) { - return $this->call123TestSpecialTagsAsyncWithHttpInfo($client) + return $this->call123TestSpecialTagsAsyncWithHttpInfo($client, $contentType) ->then( function ($response) { return $response[0]; @@ -261,14 +267,15 @@ class AnotherFakeApi * To test special tags * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['call123TestSpecialTags'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function call123TestSpecialTagsAsyncWithHttpInfo($client) + public function call123TestSpecialTagsAsyncWithHttpInfo($client, string $contentType = self::contentTypes['call123TestSpecialTags'][0]) { $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->call123TestSpecialTagsRequest($client); + $request = $this->call123TestSpecialTagsRequest($client, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -310,11 +317,12 @@ class AnotherFakeApi * Create request for operation 'call123TestSpecialTags' * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['call123TestSpecialTags'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function call123TestSpecialTagsRequest($client) + public function call123TestSpecialTagsRequest($client, string $contentType = self::contentTypes['call123TestSpecialTags'][0]) { // verify the required parameter 'client' is set @@ -324,6 +332,7 @@ class AnotherFakeApi ); } + $resourcePath = '/another-fake/dummy'; $formParams = []; $queryParams = []; @@ -335,20 +344,16 @@ class AnotherFakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($client)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($client)); } else { $httpBody = $client; @@ -368,9 +373,9 @@ class AnotherFakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index 7e7ccb46bc5..cf09778e7ad 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -69,7 +69,14 @@ class DefaultApi */ protected $hostIndex; - /** + /** @var string[] $contentTypes **/ + public const contentTypes = [ + 'fooGet' => [ + 'application/json', + ], + ]; + +/** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -118,28 +125,30 @@ class DefaultApi /** * Operation fooGet * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fooGet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\FooGetDefaultResponse */ - public function fooGet() + public function fooGet(string $contentType = self::contentTypes['fooGet'][0]) { - list($response) = $this->fooGetWithHttpInfo(); + list($response) = $this->fooGetWithHttpInfo($contentType); return $response; } /** * Operation fooGetWithHttpInfo * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fooGet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\FooGetDefaultResponse, HTTP status code, HTTP response headers (array of strings) */ - public function fooGetWithHttpInfo() + public function fooGetWithHttpInfo(string $contentType = self::contentTypes['fooGet'][0]) { - $request = $this->fooGetRequest(); + $request = $this->fooGetRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -177,7 +186,6 @@ class DefaultApi } switch($statusCode) { - default: if ('\OpenAPI\Client\Model\FooGetDefaultResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -193,7 +201,6 @@ class DefaultApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = '\OpenAPI\Client\Model\FooGetDefaultResponse'; @@ -214,7 +221,6 @@ class DefaultApi } catch (ApiException $e) { switch ($e->getCode()) { - default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -223,7 +229,6 @@ class DefaultApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -232,13 +237,14 @@ class DefaultApi /** * Operation fooGetAsync * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fooGet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fooGetAsync() + public function fooGetAsync(string $contentType = self::contentTypes['fooGet'][0]) { - return $this->fooGetAsyncWithHttpInfo() + return $this->fooGetAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -249,14 +255,15 @@ class DefaultApi /** * Operation fooGetAsyncWithHttpInfo * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fooGet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fooGetAsyncWithHttpInfo() + public function fooGetAsyncWithHttpInfo(string $contentType = self::contentTypes['fooGet'][0]) { $returnType = '\OpenAPI\Client\Model\FooGetDefaultResponse'; - $request = $this->fooGetRequest(); + $request = $this->fooGetRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -297,13 +304,15 @@ class DefaultApi /** * Create request for operation 'fooGet' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fooGet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fooGetRequest() + public function fooGetRequest(string $contentType = self::contentTypes['fooGet'][0]) { + $resourcePath = '/foo'; $formParams = []; $queryParams = []; @@ -315,16 +324,11 @@ class DefaultApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -342,9 +346,9 @@ class DefaultApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 135b02372a0..e0c2678c121 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -69,7 +69,63 @@ class FakeApi */ protected $hostIndex; - /** + /** @var string[] $contentTypes **/ + public const contentTypes = [ + 'fakeHealthGet' => [ + 'application/json', + ], + 'fakeHttpSignatureTest' => [ + 'application/json', + 'application/xml', + ], + 'fakeOuterBooleanSerialize' => [ + 'application/json', + ], + 'fakeOuterCompositeSerialize' => [ + 'application/json', + ], + 'fakeOuterNumberSerialize' => [ + 'application/json', + ], + 'fakeOuterStringSerialize' => [ + 'application/json', + ], + 'fakePropertyEnumIntegerSerialize' => [ + 'application/json', + ], + 'testBodyWithBinary' => [ + 'image/png', + ], + 'testBodyWithFileSchema' => [ + 'application/json', + ], + 'testBodyWithQueryParams' => [ + 'application/json', + ], + 'testClientModel' => [ + 'application/json', + ], + 'testEndpointParameters' => [ + 'application/x-www-form-urlencoded', + ], + 'testEnumParameters' => [ + 'application/x-www-form-urlencoded', + ], + 'testGroupParameters' => [ + 'application/json', + ], + 'testInlineAdditionalProperties' => [ + 'application/json', + ], + 'testJsonFormData' => [ + 'application/x-www-form-urlencoded', + ], + 'testQueryParameterCollectionFormat' => [ + 'application/json', + ], + ]; + +/** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -120,14 +176,15 @@ class FakeApi * * Health check endpoint * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHealthGet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\HealthCheckResult */ - public function fakeHealthGet() + public function fakeHealthGet(string $contentType = self::contentTypes['fakeHealthGet'][0]) { - list($response) = $this->fakeHealthGetWithHttpInfo(); + list($response) = $this->fakeHealthGetWithHttpInfo($contentType); return $response; } @@ -136,14 +193,15 @@ class FakeApi * * Health check endpoint * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHealthGet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\HealthCheckResult, HTTP status code, HTTP response headers (array of strings) */ - public function fakeHealthGetWithHttpInfo() + public function fakeHealthGetWithHttpInfo(string $contentType = self::contentTypes['fakeHealthGet'][0]) { - $request = $this->fakeHealthGetRequest(); + $request = $this->fakeHealthGetRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -181,7 +239,6 @@ class FakeApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\HealthCheckResult' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -197,7 +254,6 @@ class FakeApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = '\OpenAPI\Client\Model\HealthCheckResult'; @@ -218,7 +274,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -227,7 +282,6 @@ class FakeApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -238,13 +292,14 @@ class FakeApi * * Health check endpoint * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHealthGet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeHealthGetAsync() + public function fakeHealthGetAsync(string $contentType = self::contentTypes['fakeHealthGet'][0]) { - return $this->fakeHealthGetAsyncWithHttpInfo() + return $this->fakeHealthGetAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -257,14 +312,15 @@ class FakeApi * * Health check endpoint * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHealthGet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeHealthGetAsyncWithHttpInfo() + public function fakeHealthGetAsyncWithHttpInfo(string $contentType = self::contentTypes['fakeHealthGet'][0]) { $returnType = '\OpenAPI\Client\Model\HealthCheckResult'; - $request = $this->fakeHealthGetRequest(); + $request = $this->fakeHealthGetRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -305,13 +361,15 @@ class FakeApi /** * Create request for operation 'fakeHealthGet' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHealthGet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fakeHealthGetRequest() + public function fakeHealthGetRequest(string $contentType = self::contentTypes['fakeHealthGet'][0]) { + $resourcePath = '/fake/health'; $formParams = []; $queryParams = []; @@ -323,16 +381,11 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -350,9 +403,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -389,14 +442,15 @@ class FakeApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param string $query_1 query parameter (optional) * @param string $header_1 header parameter (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function fakeHttpSignatureTest($pet, $query_1 = null, $header_1 = null) + public function fakeHttpSignatureTest($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]) { - $this->fakeHttpSignatureTestWithHttpInfo($pet, $query_1, $header_1); + $this->fakeHttpSignatureTestWithHttpInfo($pet, $query_1, $header_1, $contentType); } /** @@ -407,14 +461,15 @@ class FakeApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param string $query_1 query parameter (optional) * @param string $header_1 header parameter (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function fakeHttpSignatureTestWithHttpInfo($pet, $query_1 = null, $header_1 = null) + public function fakeHttpSignatureTestWithHttpInfo($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]) { - $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1); + $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1, $contentType); try { $options = $this->createHttpClientOption(); @@ -455,7 +510,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -469,13 +523,14 @@ class FakeApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param string $query_1 query parameter (optional) * @param string $header_1 header parameter (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeHttpSignatureTestAsync($pet, $query_1 = null, $header_1 = null) + public function fakeHttpSignatureTestAsync($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]) { - return $this->fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1, $header_1) + return $this->fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1, $header_1, $contentType) ->then( function ($response) { return $response[0]; @@ -491,14 +546,15 @@ class FakeApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param string $query_1 query parameter (optional) * @param string $header_1 header parameter (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1 = null, $header_1 = null) + public function fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]) { $returnType = ''; - $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1); + $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -529,11 +585,12 @@ class FakeApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param string $query_1 query parameter (optional) * @param string $header_1 header parameter (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeHttpSignatureTest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fakeHttpSignatureTestRequest($pet, $query_1 = null, $header_1 = null) + public function fakeHttpSignatureTestRequest($pet, $query_1 = null, $header_1 = null, string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]) { // verify the required parameter 'pet' is set @@ -545,6 +602,7 @@ class FakeApi + $resourcePath = '/fake/http-signature-test'; $formParams = []; $queryParams = []; @@ -569,20 +627,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json', 'application/xml'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pet)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pet)); } else { $httpBody = $pet; @@ -602,9 +656,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -637,14 +691,15 @@ class FakeApi * Operation fakeOuterBooleanSerialize * * @param bool $body Input boolean as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterBooleanSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return bool */ - public function fakeOuterBooleanSerialize($body = null) + public function fakeOuterBooleanSerialize($body = null, string $contentType = self::contentTypes['fakeOuterBooleanSerialize'][0]) { - list($response) = $this->fakeOuterBooleanSerializeWithHttpInfo($body); + list($response) = $this->fakeOuterBooleanSerializeWithHttpInfo($body, $contentType); return $response; } @@ -652,14 +707,15 @@ class FakeApi * Operation fakeOuterBooleanSerializeWithHttpInfo * * @param bool $body Input boolean as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterBooleanSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of bool, HTTP status code, HTTP response headers (array of strings) */ - public function fakeOuterBooleanSerializeWithHttpInfo($body = null) + public function fakeOuterBooleanSerializeWithHttpInfo($body = null, string $contentType = self::contentTypes['fakeOuterBooleanSerialize'][0]) { - $request = $this->fakeOuterBooleanSerializeRequest($body); + $request = $this->fakeOuterBooleanSerializeRequest($body, $contentType); try { $options = $this->createHttpClientOption(); @@ -697,7 +753,6 @@ class FakeApi } switch($statusCode) { - case 200: if ('bool' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -713,7 +768,6 @@ class FakeApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = 'bool'; @@ -734,7 +788,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -743,7 +796,6 @@ class FakeApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -753,13 +805,14 @@ class FakeApi * Operation fakeOuterBooleanSerializeAsync * * @param bool $body Input boolean as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterBooleanSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterBooleanSerializeAsync($body = null) + public function fakeOuterBooleanSerializeAsync($body = null, string $contentType = self::contentTypes['fakeOuterBooleanSerialize'][0]) { - return $this->fakeOuterBooleanSerializeAsyncWithHttpInfo($body) + return $this->fakeOuterBooleanSerializeAsyncWithHttpInfo($body, $contentType) ->then( function ($response) { return $response[0]; @@ -771,14 +824,15 @@ class FakeApi * Operation fakeOuterBooleanSerializeAsyncWithHttpInfo * * @param bool $body Input boolean as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterBooleanSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterBooleanSerializeAsyncWithHttpInfo($body = null) + public function fakeOuterBooleanSerializeAsyncWithHttpInfo($body = null, string $contentType = self::contentTypes['fakeOuterBooleanSerialize'][0]) { $returnType = 'bool'; - $request = $this->fakeOuterBooleanSerializeRequest($body); + $request = $this->fakeOuterBooleanSerializeRequest($body, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -820,14 +874,16 @@ class FakeApi * Create request for operation 'fakeOuterBooleanSerialize' * * @param bool $body Input boolean as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterBooleanSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fakeOuterBooleanSerializeRequest($body = null) + public function fakeOuterBooleanSerializeRequest($body = null, string $contentType = self::contentTypes['fakeOuterBooleanSerialize'][0]) { + $resourcePath = '/fake/outer/boolean'; $formParams = []; $queryParams = []; @@ -839,20 +895,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['*/*', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($body)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); } else { $httpBody = $body; @@ -872,9 +924,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -907,14 +959,15 @@ class FakeApi * Operation fakeOuterCompositeSerialize * * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterCompositeSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OuterComposite */ - public function fakeOuterCompositeSerialize($outer_composite = null) + public function fakeOuterCompositeSerialize($outer_composite = null, string $contentType = self::contentTypes['fakeOuterCompositeSerialize'][0]) { - list($response) = $this->fakeOuterCompositeSerializeWithHttpInfo($outer_composite); + list($response) = $this->fakeOuterCompositeSerializeWithHttpInfo($outer_composite, $contentType); return $response; } @@ -922,14 +975,15 @@ class FakeApi * Operation fakeOuterCompositeSerializeWithHttpInfo * * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterCompositeSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OuterComposite, HTTP status code, HTTP response headers (array of strings) */ - public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) + public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null, string $contentType = self::contentTypes['fakeOuterCompositeSerialize'][0]) { - $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); + $request = $this->fakeOuterCompositeSerializeRequest($outer_composite, $contentType); try { $options = $this->createHttpClientOption(); @@ -967,7 +1021,6 @@ class FakeApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\OuterComposite' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -983,7 +1036,6 @@ class FakeApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = '\OpenAPI\Client\Model\OuterComposite'; @@ -1004,7 +1056,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1013,7 +1064,6 @@ class FakeApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -1023,13 +1073,14 @@ class FakeApi * Operation fakeOuterCompositeSerializeAsync * * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterCompositeSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterCompositeSerializeAsync($outer_composite = null) + public function fakeOuterCompositeSerializeAsync($outer_composite = null, string $contentType = self::contentTypes['fakeOuterCompositeSerialize'][0]) { - return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite) + return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite, $contentType) ->then( function ($response) { return $response[0]; @@ -1041,14 +1092,15 @@ class FakeApi * Operation fakeOuterCompositeSerializeAsyncWithHttpInfo * * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterCompositeSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite = null) + public function fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite = null, string $contentType = self::contentTypes['fakeOuterCompositeSerialize'][0]) { $returnType = '\OpenAPI\Client\Model\OuterComposite'; - $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); + $request = $this->fakeOuterCompositeSerializeRequest($outer_composite, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1090,14 +1142,16 @@ class FakeApi * Create request for operation 'fakeOuterCompositeSerialize' * * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterCompositeSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fakeOuterCompositeSerializeRequest($outer_composite = null) + public function fakeOuterCompositeSerializeRequest($outer_composite = null, string $contentType = self::contentTypes['fakeOuterCompositeSerialize'][0]) { + $resourcePath = '/fake/outer/composite'; $formParams = []; $queryParams = []; @@ -1109,20 +1163,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['*/*', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($outer_composite)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($outer_composite)); } else { $httpBody = $outer_composite; @@ -1142,9 +1192,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1177,14 +1227,15 @@ class FakeApi * Operation fakeOuterNumberSerialize * * @param float $body Input number as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterNumberSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return float */ - public function fakeOuterNumberSerialize($body = null) + public function fakeOuterNumberSerialize($body = null, string $contentType = self::contentTypes['fakeOuterNumberSerialize'][0]) { - list($response) = $this->fakeOuterNumberSerializeWithHttpInfo($body); + list($response) = $this->fakeOuterNumberSerializeWithHttpInfo($body, $contentType); return $response; } @@ -1192,14 +1243,15 @@ class FakeApi * Operation fakeOuterNumberSerializeWithHttpInfo * * @param float $body Input number as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterNumberSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of float, HTTP status code, HTTP response headers (array of strings) */ - public function fakeOuterNumberSerializeWithHttpInfo($body = null) + public function fakeOuterNumberSerializeWithHttpInfo($body = null, string $contentType = self::contentTypes['fakeOuterNumberSerialize'][0]) { - $request = $this->fakeOuterNumberSerializeRequest($body); + $request = $this->fakeOuterNumberSerializeRequest($body, $contentType); try { $options = $this->createHttpClientOption(); @@ -1237,7 +1289,6 @@ class FakeApi } switch($statusCode) { - case 200: if ('float' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1253,7 +1304,6 @@ class FakeApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = 'float'; @@ -1274,7 +1324,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1283,7 +1332,6 @@ class FakeApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -1293,13 +1341,14 @@ class FakeApi * Operation fakeOuterNumberSerializeAsync * * @param float $body Input number as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterNumberSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterNumberSerializeAsync($body = null) + public function fakeOuterNumberSerializeAsync($body = null, string $contentType = self::contentTypes['fakeOuterNumberSerialize'][0]) { - return $this->fakeOuterNumberSerializeAsyncWithHttpInfo($body) + return $this->fakeOuterNumberSerializeAsyncWithHttpInfo($body, $contentType) ->then( function ($response) { return $response[0]; @@ -1311,14 +1360,15 @@ class FakeApi * Operation fakeOuterNumberSerializeAsyncWithHttpInfo * * @param float $body Input number as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterNumberSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterNumberSerializeAsyncWithHttpInfo($body = null) + public function fakeOuterNumberSerializeAsyncWithHttpInfo($body = null, string $contentType = self::contentTypes['fakeOuterNumberSerialize'][0]) { $returnType = 'float'; - $request = $this->fakeOuterNumberSerializeRequest($body); + $request = $this->fakeOuterNumberSerializeRequest($body, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1360,14 +1410,16 @@ class FakeApi * Create request for operation 'fakeOuterNumberSerialize' * * @param float $body Input number as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterNumberSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fakeOuterNumberSerializeRequest($body = null) + public function fakeOuterNumberSerializeRequest($body = null, string $contentType = self::contentTypes['fakeOuterNumberSerialize'][0]) { + $resourcePath = '/fake/outer/number'; $formParams = []; $queryParams = []; @@ -1379,20 +1431,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['*/*', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($body)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); } else { $httpBody = $body; @@ -1412,9 +1460,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1447,14 +1495,15 @@ class FakeApi * Operation fakeOuterStringSerialize * * @param string $body Input string as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterStringSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return string */ - public function fakeOuterStringSerialize($body = null) + public function fakeOuterStringSerialize($body = null, string $contentType = self::contentTypes['fakeOuterStringSerialize'][0]) { - list($response) = $this->fakeOuterStringSerializeWithHttpInfo($body); + list($response) = $this->fakeOuterStringSerializeWithHttpInfo($body, $contentType); return $response; } @@ -1462,14 +1511,15 @@ class FakeApi * Operation fakeOuterStringSerializeWithHttpInfo * * @param string $body Input string as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterStringSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function fakeOuterStringSerializeWithHttpInfo($body = null) + public function fakeOuterStringSerializeWithHttpInfo($body = null, string $contentType = self::contentTypes['fakeOuterStringSerialize'][0]) { - $request = $this->fakeOuterStringSerializeRequest($body); + $request = $this->fakeOuterStringSerializeRequest($body, $contentType); try { $options = $this->createHttpClientOption(); @@ -1507,7 +1557,6 @@ class FakeApi } switch($statusCode) { - case 200: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1523,7 +1572,6 @@ class FakeApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = 'string'; @@ -1544,7 +1592,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1553,7 +1600,6 @@ class FakeApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -1563,13 +1609,14 @@ class FakeApi * Operation fakeOuterStringSerializeAsync * * @param string $body Input string as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterStringSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterStringSerializeAsync($body = null) + public function fakeOuterStringSerializeAsync($body = null, string $contentType = self::contentTypes['fakeOuterStringSerialize'][0]) { - return $this->fakeOuterStringSerializeAsyncWithHttpInfo($body) + return $this->fakeOuterStringSerializeAsyncWithHttpInfo($body, $contentType) ->then( function ($response) { return $response[0]; @@ -1581,14 +1628,15 @@ class FakeApi * Operation fakeOuterStringSerializeAsyncWithHttpInfo * * @param string $body Input string as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterStringSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterStringSerializeAsyncWithHttpInfo($body = null) + public function fakeOuterStringSerializeAsyncWithHttpInfo($body = null, string $contentType = self::contentTypes['fakeOuterStringSerialize'][0]) { $returnType = 'string'; - $request = $this->fakeOuterStringSerializeRequest($body); + $request = $this->fakeOuterStringSerializeRequest($body, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1630,14 +1678,16 @@ class FakeApi * Create request for operation 'fakeOuterStringSerialize' * * @param string $body Input string as post body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakeOuterStringSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fakeOuterStringSerializeRequest($body = null) + public function fakeOuterStringSerializeRequest($body = null, string $contentType = self::contentTypes['fakeOuterStringSerialize'][0]) { + $resourcePath = '/fake/outer/string'; $formParams = []; $queryParams = []; @@ -1649,20 +1699,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['*/*', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($body)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); } else { $httpBody = $body; @@ -1682,9 +1728,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1717,14 +1763,15 @@ class FakeApi * Operation fakePropertyEnumIntegerSerialize * * @param \OpenAPI\Client\Model\OuterObjectWithEnumProperty $outer_object_with_enum_property Input enum (int) as post body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakePropertyEnumIntegerSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OuterObjectWithEnumProperty */ - public function fakePropertyEnumIntegerSerialize($outer_object_with_enum_property) + public function fakePropertyEnumIntegerSerialize($outer_object_with_enum_property, string $contentType = self::contentTypes['fakePropertyEnumIntegerSerialize'][0]) { - list($response) = $this->fakePropertyEnumIntegerSerializeWithHttpInfo($outer_object_with_enum_property); + list($response) = $this->fakePropertyEnumIntegerSerializeWithHttpInfo($outer_object_with_enum_property, $contentType); return $response; } @@ -1732,14 +1779,15 @@ class FakeApi * Operation fakePropertyEnumIntegerSerializeWithHttpInfo * * @param \OpenAPI\Client\Model\OuterObjectWithEnumProperty $outer_object_with_enum_property Input enum (int) as post body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakePropertyEnumIntegerSerialize'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OuterObjectWithEnumProperty, HTTP status code, HTTP response headers (array of strings) */ - public function fakePropertyEnumIntegerSerializeWithHttpInfo($outer_object_with_enum_property) + public function fakePropertyEnumIntegerSerializeWithHttpInfo($outer_object_with_enum_property, string $contentType = self::contentTypes['fakePropertyEnumIntegerSerialize'][0]) { - $request = $this->fakePropertyEnumIntegerSerializeRequest($outer_object_with_enum_property); + $request = $this->fakePropertyEnumIntegerSerializeRequest($outer_object_with_enum_property, $contentType); try { $options = $this->createHttpClientOption(); @@ -1777,7 +1825,6 @@ class FakeApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\OuterObjectWithEnumProperty' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1793,7 +1840,6 @@ class FakeApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = '\OpenAPI\Client\Model\OuterObjectWithEnumProperty'; @@ -1814,7 +1860,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1823,7 +1868,6 @@ class FakeApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -1833,13 +1877,14 @@ class FakeApi * Operation fakePropertyEnumIntegerSerializeAsync * * @param \OpenAPI\Client\Model\OuterObjectWithEnumProperty $outer_object_with_enum_property Input enum (int) as post body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakePropertyEnumIntegerSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakePropertyEnumIntegerSerializeAsync($outer_object_with_enum_property) + public function fakePropertyEnumIntegerSerializeAsync($outer_object_with_enum_property, string $contentType = self::contentTypes['fakePropertyEnumIntegerSerialize'][0]) { - return $this->fakePropertyEnumIntegerSerializeAsyncWithHttpInfo($outer_object_with_enum_property) + return $this->fakePropertyEnumIntegerSerializeAsyncWithHttpInfo($outer_object_with_enum_property, $contentType) ->then( function ($response) { return $response[0]; @@ -1851,14 +1896,15 @@ class FakeApi * Operation fakePropertyEnumIntegerSerializeAsyncWithHttpInfo * * @param \OpenAPI\Client\Model\OuterObjectWithEnumProperty $outer_object_with_enum_property Input enum (int) as post body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakePropertyEnumIntegerSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakePropertyEnumIntegerSerializeAsyncWithHttpInfo($outer_object_with_enum_property) + public function fakePropertyEnumIntegerSerializeAsyncWithHttpInfo($outer_object_with_enum_property, string $contentType = self::contentTypes['fakePropertyEnumIntegerSerialize'][0]) { $returnType = '\OpenAPI\Client\Model\OuterObjectWithEnumProperty'; - $request = $this->fakePropertyEnumIntegerSerializeRequest($outer_object_with_enum_property); + $request = $this->fakePropertyEnumIntegerSerializeRequest($outer_object_with_enum_property, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1900,11 +1946,12 @@ class FakeApi * Create request for operation 'fakePropertyEnumIntegerSerialize' * * @param \OpenAPI\Client\Model\OuterObjectWithEnumProperty $outer_object_with_enum_property Input enum (int) as post body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fakePropertyEnumIntegerSerialize'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fakePropertyEnumIntegerSerializeRequest($outer_object_with_enum_property) + public function fakePropertyEnumIntegerSerializeRequest($outer_object_with_enum_property, string $contentType = self::contentTypes['fakePropertyEnumIntegerSerialize'][0]) { // verify the required parameter 'outer_object_with_enum_property' is set @@ -1914,6 +1961,7 @@ class FakeApi ); } + $resourcePath = '/fake/property/enum-int'; $formParams = []; $queryParams = []; @@ -1925,20 +1973,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['*/*', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($outer_object_with_enum_property)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($outer_object_with_enum_property)); } else { $httpBody = $outer_object_with_enum_property; @@ -1958,9 +2002,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1993,28 +2037,30 @@ class FakeApi * Operation testBodyWithBinary * * @param \SplFileObject $body image to upload (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testBodyWithBinary($body) + public function testBodyWithBinary($body, string $contentType = self::contentTypes['testBodyWithBinary'][0]) { - $this->testBodyWithBinaryWithHttpInfo($body); + $this->testBodyWithBinaryWithHttpInfo($body, $contentType); } /** * Operation testBodyWithBinaryWithHttpInfo * * @param \SplFileObject $body image to upload (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testBodyWithBinaryWithHttpInfo($body) + public function testBodyWithBinaryWithHttpInfo($body, string $contentType = self::contentTypes['testBodyWithBinary'][0]) { - $request = $this->testBodyWithBinaryRequest($body); + $request = $this->testBodyWithBinaryRequest($body, $contentType); try { $options = $this->createHttpClientOption(); @@ -2055,7 +2101,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -2065,13 +2110,14 @@ class FakeApi * Operation testBodyWithBinaryAsync * * @param \SplFileObject $body image to upload (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithBinaryAsync($body) + public function testBodyWithBinaryAsync($body, string $contentType = self::contentTypes['testBodyWithBinary'][0]) { - return $this->testBodyWithBinaryAsyncWithHttpInfo($body) + return $this->testBodyWithBinaryAsyncWithHttpInfo($body, $contentType) ->then( function ($response) { return $response[0]; @@ -2083,14 +2129,15 @@ class FakeApi * Operation testBodyWithBinaryAsyncWithHttpInfo * * @param \SplFileObject $body image to upload (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithBinaryAsyncWithHttpInfo($body) + public function testBodyWithBinaryAsyncWithHttpInfo($body, string $contentType = self::contentTypes['testBodyWithBinary'][0]) { $returnType = ''; - $request = $this->testBodyWithBinaryRequest($body); + $request = $this->testBodyWithBinaryRequest($body, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2119,11 +2166,12 @@ class FakeApi * Create request for operation 'testBodyWithBinary' * * @param \SplFileObject $body image to upload (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testBodyWithBinaryRequest($body) + public function testBodyWithBinaryRequest($body, string $contentType = self::contentTypes['testBodyWithBinary'][0]) { // verify the required parameter 'body' is set @@ -2133,6 +2181,7 @@ class FakeApi ); } + $resourcePath = '/fake/body-with-binary'; $formParams = []; $queryParams = []; @@ -2144,20 +2193,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['image/png'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($body)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); } else { $httpBody = $body; @@ -2177,9 +2222,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -2212,28 +2257,30 @@ class FakeApi * Operation testBodyWithFileSchema * * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class file_schema_test_class (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithFileSchema'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testBodyWithFileSchema($file_schema_test_class) + public function testBodyWithFileSchema($file_schema_test_class, string $contentType = self::contentTypes['testBodyWithFileSchema'][0]) { - $this->testBodyWithFileSchemaWithHttpInfo($file_schema_test_class); + $this->testBodyWithFileSchemaWithHttpInfo($file_schema_test_class, $contentType); } /** * Operation testBodyWithFileSchemaWithHttpInfo * * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithFileSchema'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) + public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class, string $contentType = self::contentTypes['testBodyWithFileSchema'][0]) { - $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class); + $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class, $contentType); try { $options = $this->createHttpClientOption(); @@ -2274,7 +2321,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -2284,13 +2330,14 @@ class FakeApi * Operation testBodyWithFileSchemaAsync * * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithFileSchema'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithFileSchemaAsync($file_schema_test_class) + public function testBodyWithFileSchemaAsync($file_schema_test_class, string $contentType = self::contentTypes['testBodyWithFileSchema'][0]) { - return $this->testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class) + return $this->testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class, $contentType) ->then( function ($response) { return $response[0]; @@ -2302,14 +2349,15 @@ class FakeApi * Operation testBodyWithFileSchemaAsyncWithHttpInfo * * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithFileSchema'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class) + public function testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class, string $contentType = self::contentTypes['testBodyWithFileSchema'][0]) { $returnType = ''; - $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class); + $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2338,11 +2386,12 @@ class FakeApi * Create request for operation 'testBodyWithFileSchema' * * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithFileSchema'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testBodyWithFileSchemaRequest($file_schema_test_class) + public function testBodyWithFileSchemaRequest($file_schema_test_class, string $contentType = self::contentTypes['testBodyWithFileSchema'][0]) { // verify the required parameter 'file_schema_test_class' is set @@ -2352,6 +2401,7 @@ class FakeApi ); } + $resourcePath = '/fake/body-with-file-schema'; $formParams = []; $queryParams = []; @@ -2363,20 +2413,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($file_schema_test_class)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($file_schema_test_class)); } else { $httpBody = $file_schema_test_class; @@ -2396,9 +2442,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -2432,14 +2478,15 @@ class FakeApi * * @param string $query query (required) * @param \OpenAPI\Client\Model\User $user user (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithQueryParams'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testBodyWithQueryParams($query, $user) + public function testBodyWithQueryParams($query, $user, string $contentType = self::contentTypes['testBodyWithQueryParams'][0]) { - $this->testBodyWithQueryParamsWithHttpInfo($query, $user); + $this->testBodyWithQueryParamsWithHttpInfo($query, $user, $contentType); } /** @@ -2447,14 +2494,15 @@ class FakeApi * * @param string $query (required) * @param \OpenAPI\Client\Model\User $user (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithQueryParams'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testBodyWithQueryParamsWithHttpInfo($query, $user) + public function testBodyWithQueryParamsWithHttpInfo($query, $user, string $contentType = self::contentTypes['testBodyWithQueryParams'][0]) { - $request = $this->testBodyWithQueryParamsRequest($query, $user); + $request = $this->testBodyWithQueryParamsRequest($query, $user, $contentType); try { $options = $this->createHttpClientOption(); @@ -2495,7 +2543,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -2506,13 +2553,14 @@ class FakeApi * * @param string $query (required) * @param \OpenAPI\Client\Model\User $user (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithQueryParams'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithQueryParamsAsync($query, $user) + public function testBodyWithQueryParamsAsync($query, $user, string $contentType = self::contentTypes['testBodyWithQueryParams'][0]) { - return $this->testBodyWithQueryParamsAsyncWithHttpInfo($query, $user) + return $this->testBodyWithQueryParamsAsyncWithHttpInfo($query, $user, $contentType) ->then( function ($response) { return $response[0]; @@ -2525,14 +2573,15 @@ class FakeApi * * @param string $query (required) * @param \OpenAPI\Client\Model\User $user (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithQueryParams'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithQueryParamsAsyncWithHttpInfo($query, $user) + public function testBodyWithQueryParamsAsyncWithHttpInfo($query, $user, string $contentType = self::contentTypes['testBodyWithQueryParams'][0]) { $returnType = ''; - $request = $this->testBodyWithQueryParamsRequest($query, $user); + $request = $this->testBodyWithQueryParamsRequest($query, $user, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2562,11 +2611,12 @@ class FakeApi * * @param string $query (required) * @param \OpenAPI\Client\Model\User $user (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithQueryParams'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testBodyWithQueryParamsRequest($query, $user) + public function testBodyWithQueryParamsRequest($query, $user, string $contentType = self::contentTypes['testBodyWithQueryParams'][0]) { // verify the required parameter 'query' is set @@ -2583,6 +2633,7 @@ class FakeApi ); } + $resourcePath = '/fake/body-with-query-params'; $formParams = []; $queryParams = []; @@ -2603,20 +2654,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($user)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user)); } else { $httpBody = $user; @@ -2636,9 +2683,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -2673,14 +2720,15 @@ class FakeApi * To test \"client\" model * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testClientModel'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Client */ - public function testClientModel($client) + public function testClientModel($client, string $contentType = self::contentTypes['testClientModel'][0]) { - list($response) = $this->testClientModelWithHttpInfo($client); + list($response) = $this->testClientModelWithHttpInfo($client, $contentType); return $response; } @@ -2690,14 +2738,15 @@ class FakeApi * To test \"client\" model * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testClientModel'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ - public function testClientModelWithHttpInfo($client) + public function testClientModelWithHttpInfo($client, string $contentType = self::contentTypes['testClientModel'][0]) { - $request = $this->testClientModelRequest($client); + $request = $this->testClientModelRequest($client, $contentType); try { $options = $this->createHttpClientOption(); @@ -2735,7 +2784,6 @@ class FakeApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2751,7 +2799,6 @@ class FakeApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = '\OpenAPI\Client\Model\Client'; @@ -2772,7 +2819,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2781,7 +2827,6 @@ class FakeApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -2793,13 +2838,14 @@ class FakeApi * To test \"client\" model * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testClientModel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testClientModelAsync($client) + public function testClientModelAsync($client, string $contentType = self::contentTypes['testClientModel'][0]) { - return $this->testClientModelAsyncWithHttpInfo($client) + return $this->testClientModelAsyncWithHttpInfo($client, $contentType) ->then( function ($response) { return $response[0]; @@ -2813,14 +2859,15 @@ class FakeApi * To test \"client\" model * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testClientModel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testClientModelAsyncWithHttpInfo($client) + public function testClientModelAsyncWithHttpInfo($client, string $contentType = self::contentTypes['testClientModel'][0]) { $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->testClientModelRequest($client); + $request = $this->testClientModelRequest($client, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2862,11 +2909,12 @@ class FakeApi * Create request for operation 'testClientModel' * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testClientModel'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testClientModelRequest($client) + public function testClientModelRequest($client, string $contentType = self::contentTypes['testClientModel'][0]) { // verify the required parameter 'client' is set @@ -2876,6 +2924,7 @@ class FakeApi ); } + $resourcePath = '/fake'; $formParams = []; $queryParams = []; @@ -2887,20 +2936,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($client)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($client)); } else { $httpBody = $client; @@ -2920,9 +2965,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -2970,14 +3015,15 @@ class FakeApi * @param \DateTime $date_time None (optional) * @param string $password None (optional) * @param string $callback None (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEndpointParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testEndpointParameters($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) + public function testEndpointParameters($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null, string $contentType = self::contentTypes['testEndpointParameters'][0]) { - $this->testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); + $this->testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback, $contentType); } /** @@ -2999,14 +3045,15 @@ class FakeApi * @param \DateTime $date_time None (optional) * @param string $password None (optional) * @param string $callback None (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEndpointParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) + public function testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null, string $contentType = self::contentTypes['testEndpointParameters'][0]) { - $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); + $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback, $contentType); try { $options = $this->createHttpClientOption(); @@ -3047,8 +3094,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - - } throw $e; } @@ -3073,13 +3118,14 @@ class FakeApi * @param \DateTime $date_time None (optional) * @param string $password None (optional) * @param string $callback None (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEndpointParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEndpointParametersAsync($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) + public function testEndpointParametersAsync($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null, string $contentType = self::contentTypes['testEndpointParameters'][0]) { - return $this->testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback) + return $this->testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback, $contentType) ->then( function ($response) { return $response[0]; @@ -3106,14 +3152,15 @@ class FakeApi * @param \DateTime $date_time None (optional) * @param string $password None (optional) * @param string $callback None (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEndpointParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) + public function testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null, string $contentType = self::contentTypes['testEndpointParameters'][0]) { $returnType = ''; - $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); + $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3155,11 +3202,12 @@ class FakeApi * @param \DateTime $date_time None (optional) * @param string $password None (optional) * @param string $callback None (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEndpointParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) + public function testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null, string $contentType = self::contentTypes['testEndpointParameters'][0]) { // verify the required parameter 'number' is set @@ -3174,8 +3222,7 @@ class FakeApi if ($number < 32.1) { throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.'); } - - + // verify the required parameter 'double' is set if ($double === null || (is_array($double) && count($double) === 0)) { throw new \InvalidArgumentException( @@ -3188,8 +3235,7 @@ class FakeApi if ($double < 67.8) { throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.'); } - - + // verify the required parameter 'pattern_without_delimiter' is set if ($pattern_without_delimiter === null || (is_array($pattern_without_delimiter) && count($pattern_without_delimiter) === 0)) { throw new \InvalidArgumentException( @@ -3199,8 +3245,7 @@ class FakeApi if (!preg_match("/^[A-Z].*/", $pattern_without_delimiter)) { throw new \InvalidArgumentException("invalid value for \"pattern_without_delimiter\" when calling FakeApi.testEndpointParameters, must conform to the pattern /^[A-Z].*/."); } - - + // verify the required parameter 'byte' is set if ($byte === null || (is_array($byte) && count($byte) === 0)) { throw new \InvalidArgumentException( @@ -3214,27 +3259,23 @@ class FakeApi if ($integer !== null && $integer < 10) { throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); } - - + if ($int32 !== null && $int32 > 200) { throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.'); } if ($int32 !== null && $int32 < 20) { throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.'); } - - + if ($float !== null && $float > 987.6) { throw new \InvalidArgumentException('invalid value for "$float" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.'); } - - + if ($string !== null && !preg_match("/[a-z]/i", $string)) { throw new \InvalidArgumentException("invalid value for \"string\" when calling FakeApi.testEndpointParameters, must conform to the pattern /[a-z]/i."); } - - + @@ -3244,7 +3285,7 @@ class FakeApi if ($password !== null && strlen($password) < 10) { throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); } - + $resourcePath = '/fake'; @@ -3322,16 +3363,11 @@ class FakeApi $formParams['callback'] = ObjectSerializer::toFormValue($callback); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/x-www-form-urlencoded'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3349,9 +3385,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -3398,14 +3434,15 @@ class FakeApi * @param \OpenAPI\Client\Model\EnumClass[] $enum_query_model_array enum_query_model_array (optional) * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEnumParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testEnumParameters($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_query_model_array = null, $enum_form_string_array = '$', $enum_form_string = '-efg') + public function testEnumParameters($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_query_model_array = null, $enum_form_string_array = '$', $enum_form_string = '-efg', string $contentType = self::contentTypes['testEnumParameters'][0]) { - $this->testEnumParametersWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_query_model_array, $enum_form_string_array, $enum_form_string); + $this->testEnumParametersWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_query_model_array, $enum_form_string_array, $enum_form_string, $contentType); } /** @@ -3422,14 +3459,15 @@ class FakeApi * @param \OpenAPI\Client\Model\EnumClass[] $enum_query_model_array (optional) * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEnumParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testEnumParametersWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_query_model_array = null, $enum_form_string_array = '$', $enum_form_string = '-efg') + public function testEnumParametersWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_query_model_array = null, $enum_form_string_array = '$', $enum_form_string = '-efg', string $contentType = self::contentTypes['testEnumParameters'][0]) { - $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_query_model_array, $enum_form_string_array, $enum_form_string); + $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_query_model_array, $enum_form_string_array, $enum_form_string, $contentType); try { $options = $this->createHttpClientOption(); @@ -3470,8 +3508,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - - } throw $e; } @@ -3491,13 +3527,14 @@ class FakeApi * @param \OpenAPI\Client\Model\EnumClass[] $enum_query_model_array (optional) * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEnumParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEnumParametersAsync($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_query_model_array = null, $enum_form_string_array = '$', $enum_form_string = '-efg') + public function testEnumParametersAsync($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_query_model_array = null, $enum_form_string_array = '$', $enum_form_string = '-efg', string $contentType = self::contentTypes['testEnumParameters'][0]) { - return $this->testEnumParametersAsyncWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_query_model_array, $enum_form_string_array, $enum_form_string) + return $this->testEnumParametersAsyncWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_query_model_array, $enum_form_string_array, $enum_form_string, $contentType) ->then( function ($response) { return $response[0]; @@ -3519,14 +3556,15 @@ class FakeApi * @param \OpenAPI\Client\Model\EnumClass[] $enum_query_model_array (optional) * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEnumParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEnumParametersAsyncWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_query_model_array = null, $enum_form_string_array = '$', $enum_form_string = '-efg') + public function testEnumParametersAsyncWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_query_model_array = null, $enum_form_string_array = '$', $enum_form_string = '-efg', string $contentType = self::contentTypes['testEnumParameters'][0]) { $returnType = ''; - $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_query_model_array, $enum_form_string_array, $enum_form_string); + $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_query_model_array, $enum_form_string_array, $enum_form_string, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3563,11 +3601,12 @@ class FakeApi * @param \OpenAPI\Client\Model\EnumClass[] $enum_query_model_array (optional) * @param string[] $enum_form_string_array Form parameter enum test (string array) (optional, default to '$') * @param string $enum_form_string Form parameter enum test (string) (optional, default to '-efg') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testEnumParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testEnumParametersRequest($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_query_model_array = null, $enum_form_string_array = '$', $enum_form_string = '-efg') + public function testEnumParametersRequest($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_query_model_array = null, $enum_form_string_array = '$', $enum_form_string = '-efg', string $contentType = self::contentTypes['testEnumParameters'][0]) { @@ -3579,6 +3618,7 @@ class FakeApi + $resourcePath = '/fake'; $formParams = []; $queryParams = []; @@ -3654,16 +3694,11 @@ class FakeApi $formParams['enum_form_string'] = ObjectSerializer::toFormValue($enum_form_string); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/x-www-form-urlencoded'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3681,9 +3716,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -3725,6 +3760,7 @@ class FakeApi * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testGroupParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3748,6 +3784,7 @@ class FakeApi * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testGroupParameters'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3796,7 +3833,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -3815,6 +3851,7 @@ class FakeApi * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testGroupParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3842,6 +3879,7 @@ class FakeApi * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testGroupParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3885,6 +3923,7 @@ class FakeApi * @param int $string_group String in group parameters (optional) * @param bool $boolean_group Boolean in group parameters (optional) * @param int $int64_group Integer in group parameters (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testGroupParameters'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3898,7 +3937,8 @@ class FakeApi $string_group = array_key_exists('string_group', $associative_array) ? $associative_array['string_group'] : null; $boolean_group = array_key_exists('boolean_group', $associative_array) ? $associative_array['boolean_group'] : null; $int64_group = array_key_exists('int64_group', $associative_array) ? $associative_array['int64_group'] : null; - + $contentType = $associative_array['contentType'] ?? self::contentTypes['testGroupParameters'][0]; + // verify the required parameter 'required_string_group' is set if ($required_string_group === null || (is_array($required_string_group) && count($required_string_group) === 0)) { throw new \InvalidArgumentException( @@ -3923,6 +3963,7 @@ class FakeApi + $resourcePath = '/fake'; $formParams = []; $queryParams = []; @@ -3978,16 +4019,11 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4005,9 +4041,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -4046,14 +4082,15 @@ class FakeApi * test inline additionalProperties * * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineAdditionalProperties'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testInlineAdditionalProperties($request_body) + public function testInlineAdditionalProperties($request_body, string $contentType = self::contentTypes['testInlineAdditionalProperties'][0]) { - $this->testInlineAdditionalPropertiesWithHttpInfo($request_body); + $this->testInlineAdditionalPropertiesWithHttpInfo($request_body, $contentType); } /** @@ -4062,14 +4099,15 @@ class FakeApi * test inline additionalProperties * * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineAdditionalProperties'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testInlineAdditionalPropertiesWithHttpInfo($request_body) + public function testInlineAdditionalPropertiesWithHttpInfo($request_body, string $contentType = self::contentTypes['testInlineAdditionalProperties'][0]) { - $request = $this->testInlineAdditionalPropertiesRequest($request_body); + $request = $this->testInlineAdditionalPropertiesRequest($request_body, $contentType); try { $options = $this->createHttpClientOption(); @@ -4110,7 +4148,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -4122,13 +4159,14 @@ class FakeApi * test inline additionalProperties * * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineAdditionalProperties'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testInlineAdditionalPropertiesAsync($request_body) + public function testInlineAdditionalPropertiesAsync($request_body, string $contentType = self::contentTypes['testInlineAdditionalProperties'][0]) { - return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) + return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body, $contentType) ->then( function ($response) { return $response[0]; @@ -4142,14 +4180,15 @@ class FakeApi * test inline additionalProperties * * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineAdditionalProperties'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) + public function testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body, string $contentType = self::contentTypes['testInlineAdditionalProperties'][0]) { $returnType = ''; - $request = $this->testInlineAdditionalPropertiesRequest($request_body); + $request = $this->testInlineAdditionalPropertiesRequest($request_body, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4178,11 +4217,12 @@ class FakeApi * Create request for operation 'testInlineAdditionalProperties' * * @param array $request_body request body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testInlineAdditionalProperties'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testInlineAdditionalPropertiesRequest($request_body) + public function testInlineAdditionalPropertiesRequest($request_body, string $contentType = self::contentTypes['testInlineAdditionalProperties'][0]) { // verify the required parameter 'request_body' is set @@ -4192,6 +4232,7 @@ class FakeApi ); } + $resourcePath = '/fake/inline-additionalProperties'; $formParams = []; $queryParams = []; @@ -4203,20 +4244,16 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($request_body)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($request_body)); } else { $httpBody = $request_body; @@ -4236,9 +4273,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -4274,14 +4311,15 @@ class FakeApi * * @param string $param field1 (required) * @param string $param2 field2 (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testJsonFormData'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testJsonFormData($param, $param2) + public function testJsonFormData($param, $param2, string $contentType = self::contentTypes['testJsonFormData'][0]) { - $this->testJsonFormDataWithHttpInfo($param, $param2); + $this->testJsonFormDataWithHttpInfo($param, $param2, $contentType); } /** @@ -4291,14 +4329,15 @@ class FakeApi * * @param string $param field1 (required) * @param string $param2 field2 (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testJsonFormData'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testJsonFormDataWithHttpInfo($param, $param2) + public function testJsonFormDataWithHttpInfo($param, $param2, string $contentType = self::contentTypes['testJsonFormData'][0]) { - $request = $this->testJsonFormDataRequest($param, $param2); + $request = $this->testJsonFormDataRequest($param, $param2, $contentType); try { $options = $this->createHttpClientOption(); @@ -4339,7 +4378,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -4352,13 +4390,14 @@ class FakeApi * * @param string $param field1 (required) * @param string $param2 field2 (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testJsonFormData'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testJsonFormDataAsync($param, $param2) + public function testJsonFormDataAsync($param, $param2, string $contentType = self::contentTypes['testJsonFormData'][0]) { - return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2) + return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2, $contentType) ->then( function ($response) { return $response[0]; @@ -4373,14 +4412,15 @@ class FakeApi * * @param string $param field1 (required) * @param string $param2 field2 (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testJsonFormData'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testJsonFormDataAsyncWithHttpInfo($param, $param2) + public function testJsonFormDataAsyncWithHttpInfo($param, $param2, string $contentType = self::contentTypes['testJsonFormData'][0]) { $returnType = ''; - $request = $this->testJsonFormDataRequest($param, $param2); + $request = $this->testJsonFormDataRequest($param, $param2, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4410,11 +4450,12 @@ class FakeApi * * @param string $param field1 (required) * @param string $param2 field2 (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testJsonFormData'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testJsonFormDataRequest($param, $param2) + public function testJsonFormDataRequest($param, $param2, string $contentType = self::contentTypes['testJsonFormData'][0]) { // verify the required parameter 'param' is set @@ -4431,6 +4472,7 @@ class FakeApi ); } + $resourcePath = '/fake/jsonFormData'; $formParams = []; $queryParams = []; @@ -4450,16 +4492,11 @@ class FakeApi $formParams['param2'] = ObjectSerializer::toFormValue($param2); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/x-www-form-urlencoded'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4477,9 +4514,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -4518,14 +4555,15 @@ class FakeApi * @param string[] $context context (required) * @param string $allow_empty allow_empty (required) * @param array $language language (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testQueryParameterCollectionFormat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) + public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null, string $contentType = self::contentTypes['testQueryParameterCollectionFormat'][0]) { - $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); + $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language, $contentType); } /** @@ -4538,14 +4576,15 @@ class FakeApi * @param string[] $context (required) * @param string $allow_empty (required) * @param array $language (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testQueryParameterCollectionFormat'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) + public function testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null, string $contentType = self::contentTypes['testQueryParameterCollectionFormat'][0]) { - $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language, $contentType); try { $options = $this->createHttpClientOption(); @@ -4586,7 +4625,6 @@ class FakeApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -4602,13 +4640,14 @@ class FakeApi * @param string[] $context (required) * @param string $allow_empty (required) * @param array $language (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testQueryParameterCollectionFormat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) + public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null, string $contentType = self::contentTypes['testQueryParameterCollectionFormat'][0]) { - return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language) + return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language, $contentType) ->then( function ($response) { return $response[0]; @@ -4626,14 +4665,15 @@ class FakeApi * @param string[] $context (required) * @param string $allow_empty (required) * @param array $language (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testQueryParameterCollectionFormat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) + public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null, string $contentType = self::contentTypes['testQueryParameterCollectionFormat'][0]) { $returnType = ''; - $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4668,11 +4708,12 @@ class FakeApi * @param string[] $context (required) * @param string $allow_empty (required) * @param array $language (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testQueryParameterCollectionFormat'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) + public function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null, string $contentType = self::contentTypes['testQueryParameterCollectionFormat'][0]) { // verify the required parameter 'pipe' is set @@ -4718,6 +4759,7 @@ class FakeApi } + $resourcePath = '/fake/test-query-parameters'; $formParams = []; $queryParams = []; @@ -4792,16 +4834,11 @@ class FakeApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4819,9 +4856,9 @@ class FakeApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 57cd522ebe9..255fb515f15 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -69,7 +69,14 @@ class FakeClassnameTags123Api */ protected $hostIndex; - /** + /** @var string[] $contentTypes **/ + public const contentTypes = [ + 'testClassname' => [ + 'application/json', + ], + ]; + +/** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -121,14 +128,15 @@ class FakeClassnameTags123Api * To test class name in snake case * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testClassname'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Client */ - public function testClassname($client) + public function testClassname($client, string $contentType = self::contentTypes['testClassname'][0]) { - list($response) = $this->testClassnameWithHttpInfo($client); + list($response) = $this->testClassnameWithHttpInfo($client, $contentType); return $response; } @@ -138,14 +146,15 @@ class FakeClassnameTags123Api * To test class name in snake case * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testClassname'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ - public function testClassnameWithHttpInfo($client) + public function testClassnameWithHttpInfo($client, string $contentType = self::contentTypes['testClassname'][0]) { - $request = $this->testClassnameRequest($client); + $request = $this->testClassnameRequest($client, $contentType); try { $options = $this->createHttpClientOption(); @@ -183,7 +192,6 @@ class FakeClassnameTags123Api } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -199,7 +207,6 @@ class FakeClassnameTags123Api $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = '\OpenAPI\Client\Model\Client'; @@ -220,7 +227,6 @@ class FakeClassnameTags123Api } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -229,7 +235,6 @@ class FakeClassnameTags123Api ); $e->setResponseObject($data); break; - } throw $e; } @@ -241,13 +246,14 @@ class FakeClassnameTags123Api * To test class name in snake case * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testClassname'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testClassnameAsync($client) + public function testClassnameAsync($client, string $contentType = self::contentTypes['testClassname'][0]) { - return $this->testClassnameAsyncWithHttpInfo($client) + return $this->testClassnameAsyncWithHttpInfo($client, $contentType) ->then( function ($response) { return $response[0]; @@ -261,14 +267,15 @@ class FakeClassnameTags123Api * To test class name in snake case * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testClassname'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testClassnameAsyncWithHttpInfo($client) + public function testClassnameAsyncWithHttpInfo($client, string $contentType = self::contentTypes['testClassname'][0]) { $returnType = '\OpenAPI\Client\Model\Client'; - $request = $this->testClassnameRequest($client); + $request = $this->testClassnameRequest($client, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -310,11 +317,12 @@ class FakeClassnameTags123Api * Create request for operation 'testClassname' * * @param \OpenAPI\Client\Model\Client $client client model (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testClassname'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testClassnameRequest($client) + public function testClassnameRequest($client, string $contentType = self::contentTypes['testClassname'][0]) { // verify the required parameter 'client' is set @@ -324,6 +332,7 @@ class FakeClassnameTags123Api ); } + $resourcePath = '/fake_classname_test'; $formParams = []; $queryParams = []; @@ -335,20 +344,16 @@ class FakeClassnameTags123Api - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($client)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($client)); } else { $httpBody = $client; @@ -368,9 +373,9 @@ class FakeClassnameTags123Api // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index aad92adc42b..8ac437d00af 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -69,7 +69,40 @@ class PetApi */ protected $hostIndex; - /** + /** @var string[] $contentTypes **/ + public const contentTypes = [ + 'addPet' => [ + 'application/json', + 'application/xml', + ], + 'deletePet' => [ + 'application/json', + ], + 'findPetsByStatus' => [ + 'application/json', + ], + 'findPetsByTags' => [ + 'application/json', + ], + 'getPetById' => [ + 'application/json', + ], + 'updatePet' => [ + 'application/json', + 'application/xml', + ], + 'updatePetWithForm' => [ + 'application/x-www-form-urlencoded', + ], + 'uploadFile' => [ + 'multipart/form-data', + ], + 'uploadFileWithRequiredFile' => [ + 'multipart/form-data', + ], + ]; + +/** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -139,14 +172,15 @@ class PetApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function addPet($pet, ?int $hostIndex = null, array $variables = []) + public function addPet($pet, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['addPet'][0]) { - $this->addPetWithHttpInfo($pet, $hostIndex, $variables); + $this->addPetWithHttpInfo($pet, $hostIndex, $variables, $contentType); } /** @@ -173,14 +207,15 @@ class PetApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function addPetWithHttpInfo($pet, ?int $hostIndex = null, array $variables = []) + public function addPetWithHttpInfo($pet, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['addPet'][0]) { - $request = $this->addPetRequest($pet, $hostIndex, $variables); + $request = $this->addPetRequest($pet, $hostIndex, $variables, $contentType); try { $options = $this->createHttpClientOption(); @@ -221,8 +256,6 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { - - } throw $e; } @@ -252,13 +285,14 @@ class PetApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addPetAsync($pet, ?int $hostIndex = null, array $variables = []) + public function addPetAsync($pet, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['addPet'][0]) { - return $this->addPetAsyncWithHttpInfo($pet, $hostIndex, $variables) + return $this->addPetAsyncWithHttpInfo($pet, $hostIndex, $variables, $contentType) ->then( function ($response) { return $response[0]; @@ -290,14 +324,15 @@ class PetApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addPetAsyncWithHttpInfo($pet, ?int $hostIndex = null, array $variables = []) + public function addPetAsyncWithHttpInfo($pet, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['addPet'][0]) { $returnType = ''; - $request = $this->addPetRequest($pet, $hostIndex, $variables); + $request = $this->addPetRequest($pet, $hostIndex, $variables, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -344,11 +379,12 @@ class PetApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addPetRequest($pet, ?int $hostIndex = null, array $variables = []) + public function addPetRequest($pet, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['addPet'][0]) { // verify the required parameter 'pet' is set @@ -358,6 +394,7 @@ class PetApi ); } + $resourcePath = '/pet'; $formParams = []; $queryParams = []; @@ -369,20 +406,16 @@ class PetApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json', 'application/xml'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pet)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pet)); } else { $httpBody = $pet; @@ -402,9 +435,9 @@ class PetApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -496,14 +529,15 @@ class PetApi * * @param int $pet_id Pet id to delete (required) * @param string $api_key api_key (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deletePet($pet_id, $api_key = null) + public function deletePet($pet_id, $api_key = null, string $contentType = self::contentTypes['deletePet'][0]) { - $this->deletePetWithHttpInfo($pet_id, $api_key); + $this->deletePetWithHttpInfo($pet_id, $api_key, $contentType); } /** @@ -513,14 +547,15 @@ class PetApi * * @param int $pet_id Pet id to delete (required) * @param string $api_key (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deletePetWithHttpInfo($pet_id, $api_key = null) + public function deletePetWithHttpInfo($pet_id, $api_key = null, string $contentType = self::contentTypes['deletePet'][0]) { - $request = $this->deletePetRequest($pet_id, $api_key); + $request = $this->deletePetRequest($pet_id, $api_key, $contentType); try { $options = $this->createHttpClientOption(); @@ -561,8 +596,6 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { - - } throw $e; } @@ -575,13 +608,14 @@ class PetApi * * @param int $pet_id Pet id to delete (required) * @param string $api_key (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePetAsync($pet_id, $api_key = null) + public function deletePetAsync($pet_id, $api_key = null, string $contentType = self::contentTypes['deletePet'][0]) { - return $this->deletePetAsyncWithHttpInfo($pet_id, $api_key) + return $this->deletePetAsyncWithHttpInfo($pet_id, $api_key, $contentType) ->then( function ($response) { return $response[0]; @@ -596,14 +630,15 @@ class PetApi * * @param int $pet_id Pet id to delete (required) * @param string $api_key (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deletePetAsyncWithHttpInfo($pet_id, $api_key = null) + public function deletePetAsyncWithHttpInfo($pet_id, $api_key = null, string $contentType = self::contentTypes['deletePet'][0]) { $returnType = ''; - $request = $this->deletePetRequest($pet_id, $api_key); + $request = $this->deletePetRequest($pet_id, $api_key, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -633,11 +668,12 @@ class PetApi * * @param int $pet_id Pet id to delete (required) * @param string $api_key (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deletePetRequest($pet_id, $api_key = null) + public function deletePetRequest($pet_id, $api_key = null, string $contentType = self::contentTypes['deletePet'][0]) { // verify the required parameter 'pet_id' is set @@ -648,6 +684,7 @@ class PetApi } + $resourcePath = '/pet/{petId}'; $formParams = []; $queryParams = []; @@ -671,16 +708,11 @@ class PetApi } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -698,9 +730,9 @@ class PetApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -739,14 +771,15 @@ class PetApi * Finds Pets by status * * @param string[] $status Status values that need to be considered for filter (required) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPetsByStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Pet[] */ - public function findPetsByStatus($status) + public function findPetsByStatus($status, string $contentType = self::contentTypes['findPetsByStatus'][0]) { - list($response) = $this->findPetsByStatusWithHttpInfo($status); + list($response) = $this->findPetsByStatusWithHttpInfo($status, $contentType); return $response; } @@ -756,14 +789,15 @@ class PetApi * Finds Pets by status * * @param string[] $status Status values that need to be considered for filter (required) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPetsByStatus'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) */ - public function findPetsByStatusWithHttpInfo($status) + public function findPetsByStatusWithHttpInfo($status, string $contentType = self::contentTypes['findPetsByStatus'][0]) { - $request = $this->findPetsByStatusRequest($status); + $request = $this->findPetsByStatusRequest($status, $contentType); try { $options = $this->createHttpClientOption(); @@ -801,7 +835,6 @@ class PetApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -817,8 +850,6 @@ class PetApi $response->getStatusCode(), $response->getHeaders() ]; - - } $returnType = '\OpenAPI\Client\Model\Pet[]'; @@ -839,7 +870,6 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -848,8 +878,6 @@ class PetApi ); $e->setResponseObject($data); break; - - } throw $e; } @@ -861,13 +889,14 @@ class PetApi * Finds Pets by status * * @param string[] $status Status values that need to be considered for filter (required) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPetsByStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findPetsByStatusAsync($status) + public function findPetsByStatusAsync($status, string $contentType = self::contentTypes['findPetsByStatus'][0]) { - return $this->findPetsByStatusAsyncWithHttpInfo($status) + return $this->findPetsByStatusAsyncWithHttpInfo($status, $contentType) ->then( function ($response) { return $response[0]; @@ -881,14 +910,15 @@ class PetApi * Finds Pets by status * * @param string[] $status Status values that need to be considered for filter (required) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPetsByStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findPetsByStatusAsyncWithHttpInfo($status) + public function findPetsByStatusAsyncWithHttpInfo($status, string $contentType = self::contentTypes['findPetsByStatus'][0]) { $returnType = '\OpenAPI\Client\Model\Pet[]'; - $request = $this->findPetsByStatusRequest($status); + $request = $this->findPetsByStatusRequest($status, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -930,11 +960,12 @@ class PetApi * Create request for operation 'findPetsByStatus' * * @param string[] $status Status values that need to be considered for filter (required) (deprecated) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPetsByStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findPetsByStatusRequest($status) + public function findPetsByStatusRequest($status, string $contentType = self::contentTypes['findPetsByStatus'][0]) { // verify the required parameter 'status' is set @@ -944,6 +975,7 @@ class PetApi ); } + $resourcePath = '/pet/findByStatus'; $formParams = []; $queryParams = []; @@ -964,16 +996,11 @@ class PetApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/xml', 'application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -991,9 +1018,9 @@ class PetApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1032,15 +1059,16 @@ class PetApi * Finds Pets by tags * * @param string[] $tags Tags to filter by (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPetsByTags'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Pet[] * @deprecated */ - public function findPetsByTags($tags) + public function findPetsByTags($tags, string $contentType = self::contentTypes['findPetsByTags'][0]) { - list($response) = $this->findPetsByTagsWithHttpInfo($tags); + list($response) = $this->findPetsByTagsWithHttpInfo($tags, $contentType); return $response; } @@ -1050,15 +1078,16 @@ class PetApi * Finds Pets by tags * * @param string[] $tags Tags to filter by (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPetsByTags'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function findPetsByTagsWithHttpInfo($tags) + public function findPetsByTagsWithHttpInfo($tags, string $contentType = self::contentTypes['findPetsByTags'][0]) { - $request = $this->findPetsByTagsRequest($tags); + $request = $this->findPetsByTagsRequest($tags, $contentType); try { $options = $this->createHttpClientOption(); @@ -1096,7 +1125,6 @@ class PetApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1112,8 +1140,6 @@ class PetApi $response->getStatusCode(), $response->getHeaders() ]; - - } $returnType = '\OpenAPI\Client\Model\Pet[]'; @@ -1134,7 +1160,6 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1143,8 +1168,6 @@ class PetApi ); $e->setResponseObject($data); break; - - } throw $e; } @@ -1156,14 +1179,15 @@ class PetApi * Finds Pets by tags * * @param string[] $tags Tags to filter by (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPetsByTags'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function findPetsByTagsAsync($tags) + public function findPetsByTagsAsync($tags, string $contentType = self::contentTypes['findPetsByTags'][0]) { - return $this->findPetsByTagsAsyncWithHttpInfo($tags) + return $this->findPetsByTagsAsyncWithHttpInfo($tags, $contentType) ->then( function ($response) { return $response[0]; @@ -1177,15 +1201,16 @@ class PetApi * Finds Pets by tags * * @param string[] $tags Tags to filter by (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPetsByTags'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function findPetsByTagsAsyncWithHttpInfo($tags) + public function findPetsByTagsAsyncWithHttpInfo($tags, string $contentType = self::contentTypes['findPetsByTags'][0]) { $returnType = '\OpenAPI\Client\Model\Pet[]'; - $request = $this->findPetsByTagsRequest($tags); + $request = $this->findPetsByTagsRequest($tags, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1227,12 +1252,13 @@ class PetApi * Create request for operation 'findPetsByTags' * * @param string[] $tags Tags to filter by (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPetsByTags'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function findPetsByTagsRequest($tags) + public function findPetsByTagsRequest($tags, string $contentType = self::contentTypes['findPetsByTags'][0]) { // verify the required parameter 'tags' is set @@ -1241,7 +1267,7 @@ class PetApi 'Missing the required parameter $tags when calling findPetsByTags' ); } - + $resourcePath = '/pet/findByTags'; $formParams = []; @@ -1263,16 +1289,11 @@ class PetApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/xml', 'application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1290,9 +1311,9 @@ class PetApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1331,14 +1352,15 @@ class PetApi * Find pet by ID * * @param int $pet_id ID of pet to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPetById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Pet */ - public function getPetById($pet_id) + public function getPetById($pet_id, string $contentType = self::contentTypes['getPetById'][0]) { - list($response) = $this->getPetByIdWithHttpInfo($pet_id); + list($response) = $this->getPetByIdWithHttpInfo($pet_id, $contentType); return $response; } @@ -1348,14 +1370,15 @@ class PetApi * Find pet by ID * * @param int $pet_id ID of pet to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPetById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Pet, HTTP status code, HTTP response headers (array of strings) */ - public function getPetByIdWithHttpInfo($pet_id) + public function getPetByIdWithHttpInfo($pet_id, string $contentType = self::contentTypes['getPetById'][0]) { - $request = $this->getPetByIdRequest($pet_id); + $request = $this->getPetByIdRequest($pet_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1393,7 +1416,6 @@ class PetApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1409,9 +1431,6 @@ class PetApi $response->getStatusCode(), $response->getHeaders() ]; - - - } $returnType = '\OpenAPI\Client\Model\Pet'; @@ -1432,7 +1451,6 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1441,9 +1459,6 @@ class PetApi ); $e->setResponseObject($data); break; - - - } throw $e; } @@ -1455,13 +1470,14 @@ class PetApi * Find pet by ID * * @param int $pet_id ID of pet to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPetById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPetByIdAsync($pet_id) + public function getPetByIdAsync($pet_id, string $contentType = self::contentTypes['getPetById'][0]) { - return $this->getPetByIdAsyncWithHttpInfo($pet_id) + return $this->getPetByIdAsyncWithHttpInfo($pet_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1475,14 +1491,15 @@ class PetApi * Find pet by ID * * @param int $pet_id ID of pet to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPetById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPetByIdAsyncWithHttpInfo($pet_id) + public function getPetByIdAsyncWithHttpInfo($pet_id, string $contentType = self::contentTypes['getPetById'][0]) { $returnType = '\OpenAPI\Client\Model\Pet'; - $request = $this->getPetByIdRequest($pet_id); + $request = $this->getPetByIdRequest($pet_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1524,11 +1541,12 @@ class PetApi * Create request for operation 'getPetById' * * @param int $pet_id ID of pet to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPetById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPetByIdRequest($pet_id) + public function getPetByIdRequest($pet_id, string $contentType = self::contentTypes['getPetById'][0]) { // verify the required parameter 'pet_id' is set @@ -1538,6 +1556,7 @@ class PetApi ); } + $resourcePath = '/pet/{petId}'; $formParams = []; $queryParams = []; @@ -1557,16 +1576,11 @@ class PetApi } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/xml', 'application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1584,9 +1598,9 @@ class PetApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1644,14 +1658,15 @@ class PetApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function updatePet($pet, ?int $hostIndex = null, array $variables = []) + public function updatePet($pet, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['updatePet'][0]) { - $this->updatePetWithHttpInfo($pet, $hostIndex, $variables); + $this->updatePetWithHttpInfo($pet, $hostIndex, $variables, $contentType); } /** @@ -1678,14 +1693,15 @@ class PetApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePet'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updatePetWithHttpInfo($pet, ?int $hostIndex = null, array $variables = []) + public function updatePetWithHttpInfo($pet, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['updatePet'][0]) { - $request = $this->updatePetRequest($pet, $hostIndex, $variables); + $request = $this->updatePetRequest($pet, $hostIndex, $variables, $contentType); try { $options = $this->createHttpClientOption(); @@ -1726,10 +1742,6 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { - - - - } throw $e; } @@ -1759,13 +1771,14 @@ class PetApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePetAsync($pet, ?int $hostIndex = null, array $variables = []) + public function updatePetAsync($pet, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['updatePet'][0]) { - return $this->updatePetAsyncWithHttpInfo($pet, $hostIndex, $variables) + return $this->updatePetAsyncWithHttpInfo($pet, $hostIndex, $variables, $contentType) ->then( function ($response) { return $response[0]; @@ -1797,14 +1810,15 @@ class PetApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePetAsyncWithHttpInfo($pet, ?int $hostIndex = null, array $variables = []) + public function updatePetAsyncWithHttpInfo($pet, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['updatePet'][0]) { $returnType = ''; - $request = $this->updatePetRequest($pet, $hostIndex, $variables); + $request = $this->updatePetRequest($pet, $hostIndex, $variables, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1851,11 +1865,12 @@ class PetApi * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePet'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePetRequest($pet, ?int $hostIndex = null, array $variables = []) + public function updatePetRequest($pet, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['updatePet'][0]) { // verify the required parameter 'pet' is set @@ -1865,6 +1880,7 @@ class PetApi ); } + $resourcePath = '/pet'; $formParams = []; $queryParams = []; @@ -1876,20 +1892,16 @@ class PetApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json', 'application/xml'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pet)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pet)); } else { $httpBody = $pet; @@ -1909,9 +1921,9 @@ class PetApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -2004,14 +2016,15 @@ class PetApi * @param int $pet_id ID of pet that needs to be updated (required) * @param string $name Updated name of the pet (optional) * @param string $status Updated status of the pet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePetWithForm'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function updatePetWithForm($pet_id, $name = null, $status = null) + public function updatePetWithForm($pet_id, $name = null, $status = null, string $contentType = self::contentTypes['updatePetWithForm'][0]) { - $this->updatePetWithFormWithHttpInfo($pet_id, $name, $status); + $this->updatePetWithFormWithHttpInfo($pet_id, $name, $status, $contentType); } /** @@ -2022,14 +2035,15 @@ class PetApi * @param int $pet_id ID of pet that needs to be updated (required) * @param string $name Updated name of the pet (optional) * @param string $status Updated status of the pet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePetWithForm'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null) + public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null, string $contentType = self::contentTypes['updatePetWithForm'][0]) { - $request = $this->updatePetWithFormRequest($pet_id, $name, $status); + $request = $this->updatePetWithFormRequest($pet_id, $name, $status, $contentType); try { $options = $this->createHttpClientOption(); @@ -2070,8 +2084,6 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { - - } throw $e; } @@ -2085,13 +2097,14 @@ class PetApi * @param int $pet_id ID of pet that needs to be updated (required) * @param string $name Updated name of the pet (optional) * @param string $status Updated status of the pet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePetWithForm'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePetWithFormAsync($pet_id, $name = null, $status = null) + public function updatePetWithFormAsync($pet_id, $name = null, $status = null, string $contentType = self::contentTypes['updatePetWithForm'][0]) { - return $this->updatePetWithFormAsyncWithHttpInfo($pet_id, $name, $status) + return $this->updatePetWithFormAsyncWithHttpInfo($pet_id, $name, $status, $contentType) ->then( function ($response) { return $response[0]; @@ -2107,14 +2120,15 @@ class PetApi * @param int $pet_id ID of pet that needs to be updated (required) * @param string $name Updated name of the pet (optional) * @param string $status Updated status of the pet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePetWithForm'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePetWithFormAsyncWithHttpInfo($pet_id, $name = null, $status = null) + public function updatePetWithFormAsyncWithHttpInfo($pet_id, $name = null, $status = null, string $contentType = self::contentTypes['updatePetWithForm'][0]) { $returnType = ''; - $request = $this->updatePetWithFormRequest($pet_id, $name, $status); + $request = $this->updatePetWithFormRequest($pet_id, $name, $status, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2145,11 +2159,12 @@ class PetApi * @param int $pet_id ID of pet that needs to be updated (required) * @param string $name Updated name of the pet (optional) * @param string $status Updated status of the pet (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePetWithForm'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePetWithFormRequest($pet_id, $name = null, $status = null) + public function updatePetWithFormRequest($pet_id, $name = null, $status = null, string $contentType = self::contentTypes['updatePetWithForm'][0]) { // verify the required parameter 'pet_id' is set @@ -2161,6 +2176,7 @@ class PetApi + $resourcePath = '/pet/{petId}'; $formParams = []; $queryParams = []; @@ -2188,16 +2204,11 @@ class PetApi $formParams['status'] = ObjectSerializer::toFormValue($status); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/x-www-form-urlencoded'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2215,9 +2226,9 @@ class PetApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -2258,14 +2269,15 @@ class PetApi * @param int $pet_id ID of pet to update (required) * @param string $additional_metadata Additional data to pass to server (optional) * @param \SplFileObject $file file to upload (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFile'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ApiResponse */ - public function uploadFile($pet_id, $additional_metadata = null, $file = null) + public function uploadFile($pet_id, $additional_metadata = null, $file = null, string $contentType = self::contentTypes['uploadFile'][0]) { - list($response) = $this->uploadFileWithHttpInfo($pet_id, $additional_metadata, $file); + list($response) = $this->uploadFileWithHttpInfo($pet_id, $additional_metadata, $file, $contentType); return $response; } @@ -2277,14 +2289,15 @@ class PetApi * @param int $pet_id ID of pet to update (required) * @param string $additional_metadata Additional data to pass to server (optional) * @param \SplFileObject $file file to upload (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFile'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null) + public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null, string $contentType = self::contentTypes['uploadFile'][0]) { - $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); + $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file, $contentType); try { $options = $this->createHttpClientOption(); @@ -2322,7 +2335,6 @@ class PetApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2338,7 +2350,6 @@ class PetApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = '\OpenAPI\Client\Model\ApiResponse'; @@ -2359,7 +2370,6 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2368,7 +2378,6 @@ class PetApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -2382,13 +2391,14 @@ class PetApi * @param int $pet_id ID of pet to update (required) * @param string $additional_metadata Additional data to pass to server (optional) * @param \SplFileObject $file file to upload (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileAsync($pet_id, $additional_metadata = null, $file = null) + public function uploadFileAsync($pet_id, $additional_metadata = null, $file = null, string $contentType = self::contentTypes['uploadFile'][0]) { - return $this->uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata, $file) + return $this->uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata, $file, $contentType) ->then( function ($response) { return $response[0]; @@ -2404,14 +2414,15 @@ class PetApi * @param int $pet_id ID of pet to update (required) * @param string $additional_metadata Additional data to pass to server (optional) * @param \SplFileObject $file file to upload (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata = null, $file = null) + public function uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata = null, $file = null, string $contentType = self::contentTypes['uploadFile'][0]) { $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); + $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2455,11 +2466,12 @@ class PetApi * @param int $pet_id ID of pet to update (required) * @param string $additional_metadata Additional data to pass to server (optional) * @param \SplFileObject $file file to upload (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function uploadFileRequest($pet_id, $additional_metadata = null, $file = null) + public function uploadFileRequest($pet_id, $additional_metadata = null, $file = null, string $contentType = self::contentTypes['uploadFile'][0]) { // verify the required parameter 'pet_id' is set @@ -2471,6 +2483,7 @@ class PetApi + $resourcePath = '/pet/{petId}/uploadImage'; $formParams = []; $queryParams = []; @@ -2506,16 +2519,11 @@ class PetApi } } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2533,9 +2541,9 @@ class PetApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -2576,14 +2584,15 @@ class PetApi * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFileWithRequiredFile'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ApiResponse */ - public function uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata = null) + public function uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata = null, string $contentType = self::contentTypes['uploadFileWithRequiredFile'][0]) { - list($response) = $this->uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata); + list($response) = $this->uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata, $contentType); return $response; } @@ -2595,14 +2604,15 @@ class PetApi * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFileWithRequiredFile'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata = null) + public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata = null, string $contentType = self::contentTypes['uploadFileWithRequiredFile'][0]) { - $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); + $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata, $contentType); try { $options = $this->createHttpClientOption(); @@ -2640,7 +2650,6 @@ class PetApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2656,7 +2665,6 @@ class PetApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = '\OpenAPI\Client\Model\ApiResponse'; @@ -2677,7 +2685,6 @@ class PetApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2686,7 +2693,6 @@ class PetApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -2700,13 +2706,14 @@ class PetApi * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFileWithRequiredFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileWithRequiredFileAsync($pet_id, $required_file, $additional_metadata = null) + public function uploadFileWithRequiredFileAsync($pet_id, $required_file, $additional_metadata = null, string $contentType = self::contentTypes['uploadFileWithRequiredFile'][0]) { - return $this->uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata) + return $this->uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata, $contentType) ->then( function ($response) { return $response[0]; @@ -2722,14 +2729,15 @@ class PetApi * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFileWithRequiredFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata = null) + public function uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata = null, string $contentType = self::contentTypes['uploadFileWithRequiredFile'][0]) { $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); + $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2773,11 +2781,12 @@ class PetApi * @param int $pet_id ID of pet to update (required) * @param \SplFileObject $required_file file to upload (required) * @param string $additional_metadata Additional data to pass to server (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadFileWithRequiredFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata = null) + public function uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata = null, string $contentType = self::contentTypes['uploadFileWithRequiredFile'][0]) { // verify the required parameter 'pet_id' is set @@ -2795,6 +2804,7 @@ class PetApi } + $resourcePath = '/fake/{petId}/uploadImageWithRequiredFile'; $formParams = []; $queryParams = []; @@ -2830,16 +2840,11 @@ class PetApi } } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2857,9 +2862,9 @@ class PetApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 783806f3b48..9a788afe4c7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -69,7 +69,23 @@ class StoreApi */ protected $hostIndex; - /** + /** @var string[] $contentTypes **/ + public const contentTypes = [ + 'deleteOrder' => [ + 'application/json', + ], + 'getInventory' => [ + 'application/json', + ], + 'getOrderById' => [ + 'application/json', + ], + 'placeOrder' => [ + 'application/json', + ], + ]; + +/** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -121,14 +137,15 @@ class StoreApi * Delete purchase order by ID * * @param string $order_id ID of the order that needs to be deleted (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteOrder($order_id) + public function deleteOrder($order_id, string $contentType = self::contentTypes['deleteOrder'][0]) { - $this->deleteOrderWithHttpInfo($order_id); + $this->deleteOrderWithHttpInfo($order_id, $contentType); } /** @@ -137,14 +154,15 @@ class StoreApi * Delete purchase order by ID * * @param string $order_id ID of the order that needs to be deleted (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteOrderWithHttpInfo($order_id) + public function deleteOrderWithHttpInfo($order_id, string $contentType = self::contentTypes['deleteOrder'][0]) { - $request = $this->deleteOrderRequest($order_id); + $request = $this->deleteOrderRequest($order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -185,8 +203,6 @@ class StoreApi } catch (ApiException $e) { switch ($e->getCode()) { - - } throw $e; } @@ -198,13 +214,14 @@ class StoreApi * Delete purchase order by ID * * @param string $order_id ID of the order that needs to be deleted (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOrderAsync($order_id) + public function deleteOrderAsync($order_id, string $contentType = self::contentTypes['deleteOrder'][0]) { - return $this->deleteOrderAsyncWithHttpInfo($order_id) + return $this->deleteOrderAsyncWithHttpInfo($order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -218,14 +235,15 @@ class StoreApi * Delete purchase order by ID * * @param string $order_id ID of the order that needs to be deleted (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteOrderAsyncWithHttpInfo($order_id) + public function deleteOrderAsyncWithHttpInfo($order_id, string $contentType = self::contentTypes['deleteOrder'][0]) { $returnType = ''; - $request = $this->deleteOrderRequest($order_id); + $request = $this->deleteOrderRequest($order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -254,11 +272,12 @@ class StoreApi * Create request for operation 'deleteOrder' * * @param string $order_id ID of the order that needs to be deleted (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteOrderRequest($order_id) + public function deleteOrderRequest($order_id, string $contentType = self::contentTypes['deleteOrder'][0]) { // verify the required parameter 'order_id' is set @@ -268,6 +287,7 @@ class StoreApi ); } + $resourcePath = '/store/order/{order_id}'; $formParams = []; $queryParams = []; @@ -287,16 +307,11 @@ class StoreApi } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -314,9 +329,9 @@ class StoreApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -350,14 +365,15 @@ class StoreApi * * Returns pet inventories by status * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInventory'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array */ - public function getInventory() + public function getInventory(string $contentType = self::contentTypes['getInventory'][0]) { - list($response) = $this->getInventoryWithHttpInfo(); + list($response) = $this->getInventoryWithHttpInfo($contentType); return $response; } @@ -366,14 +382,15 @@ class StoreApi * * Returns pet inventories by status * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInventory'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of array, HTTP status code, HTTP response headers (array of strings) */ - public function getInventoryWithHttpInfo() + public function getInventoryWithHttpInfo(string $contentType = self::contentTypes['getInventory'][0]) { - $request = $this->getInventoryRequest(); + $request = $this->getInventoryRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -411,7 +428,6 @@ class StoreApi } switch($statusCode) { - case 200: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -427,7 +443,6 @@ class StoreApi $response->getStatusCode(), $response->getHeaders() ]; - } $returnType = 'array'; @@ -448,7 +463,6 @@ class StoreApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -457,7 +471,6 @@ class StoreApi ); $e->setResponseObject($data); break; - } throw $e; } @@ -468,13 +481,14 @@ class StoreApi * * Returns pet inventories by status * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInventory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getInventoryAsync() + public function getInventoryAsync(string $contentType = self::contentTypes['getInventory'][0]) { - return $this->getInventoryAsyncWithHttpInfo() + return $this->getInventoryAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -487,14 +501,15 @@ class StoreApi * * Returns pet inventories by status * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInventory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getInventoryAsyncWithHttpInfo() + public function getInventoryAsyncWithHttpInfo(string $contentType = self::contentTypes['getInventory'][0]) { $returnType = 'array'; - $request = $this->getInventoryRequest(); + $request = $this->getInventoryRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -535,13 +550,15 @@ class StoreApi /** * Create request for operation 'getInventory' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getInventory'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getInventoryRequest() + public function getInventoryRequest(string $contentType = self::contentTypes['getInventory'][0]) { + $resourcePath = '/store/inventory'; $formParams = []; $queryParams = []; @@ -553,16 +570,11 @@ class StoreApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -580,9 +592,9 @@ class StoreApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -622,14 +634,15 @@ class StoreApi * Find purchase order by ID * * @param int $order_id ID of pet that needs to be fetched (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Order */ - public function getOrderById($order_id) + public function getOrderById($order_id, string $contentType = self::contentTypes['getOrderById'][0]) { - list($response) = $this->getOrderByIdWithHttpInfo($order_id); + list($response) = $this->getOrderByIdWithHttpInfo($order_id, $contentType); return $response; } @@ -639,14 +652,15 @@ class StoreApi * Find purchase order by ID * * @param int $order_id ID of pet that needs to be fetched (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderById'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) */ - public function getOrderByIdWithHttpInfo($order_id) + public function getOrderByIdWithHttpInfo($order_id, string $contentType = self::contentTypes['getOrderById'][0]) { - $request = $this->getOrderByIdRequest($order_id); + $request = $this->getOrderByIdRequest($order_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -684,7 +698,6 @@ class StoreApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -700,9 +713,6 @@ class StoreApi $response->getStatusCode(), $response->getHeaders() ]; - - - } $returnType = '\OpenAPI\Client\Model\Order'; @@ -723,7 +733,6 @@ class StoreApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -732,9 +741,6 @@ class StoreApi ); $e->setResponseObject($data); break; - - - } throw $e; } @@ -746,13 +752,14 @@ class StoreApi * Find purchase order by ID * * @param int $order_id ID of pet that needs to be fetched (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderByIdAsync($order_id) + public function getOrderByIdAsync($order_id, string $contentType = self::contentTypes['getOrderById'][0]) { - return $this->getOrderByIdAsyncWithHttpInfo($order_id) + return $this->getOrderByIdAsyncWithHttpInfo($order_id, $contentType) ->then( function ($response) { return $response[0]; @@ -766,14 +773,15 @@ class StoreApi * Find purchase order by ID * * @param int $order_id ID of pet that needs to be fetched (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getOrderByIdAsyncWithHttpInfo($order_id) + public function getOrderByIdAsyncWithHttpInfo($order_id, string $contentType = self::contentTypes['getOrderById'][0]) { $returnType = '\OpenAPI\Client\Model\Order'; - $request = $this->getOrderByIdRequest($order_id); + $request = $this->getOrderByIdRequest($order_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -815,11 +823,12 @@ class StoreApi * Create request for operation 'getOrderById' * * @param int $order_id ID of pet that needs to be fetched (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrderById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getOrderByIdRequest($order_id) + public function getOrderByIdRequest($order_id, string $contentType = self::contentTypes['getOrderById'][0]) { // verify the required parameter 'order_id' is set @@ -834,7 +843,7 @@ class StoreApi if ($order_id < 1) { throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.'); } - + $resourcePath = '/store/order/{order_id}'; $formParams = []; @@ -855,16 +864,11 @@ class StoreApi } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/xml', 'application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -882,9 +886,9 @@ class StoreApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -919,14 +923,15 @@ class StoreApi * Place an order for a pet * * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['placeOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Order */ - public function placeOrder($order) + public function placeOrder($order, string $contentType = self::contentTypes['placeOrder'][0]) { - list($response) = $this->placeOrderWithHttpInfo($order); + list($response) = $this->placeOrderWithHttpInfo($order, $contentType); return $response; } @@ -936,14 +941,15 @@ class StoreApi * Place an order for a pet * * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['placeOrder'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) */ - public function placeOrderWithHttpInfo($order) + public function placeOrderWithHttpInfo($order, string $contentType = self::contentTypes['placeOrder'][0]) { - $request = $this->placeOrderRequest($order); + $request = $this->placeOrderRequest($order, $contentType); try { $options = $this->createHttpClientOption(); @@ -981,7 +987,6 @@ class StoreApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -997,8 +1002,6 @@ class StoreApi $response->getStatusCode(), $response->getHeaders() ]; - - } $returnType = '\OpenAPI\Client\Model\Order'; @@ -1019,7 +1022,6 @@ class StoreApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1028,8 +1030,6 @@ class StoreApi ); $e->setResponseObject($data); break; - - } throw $e; } @@ -1041,13 +1041,14 @@ class StoreApi * Place an order for a pet * * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['placeOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function placeOrderAsync($order) + public function placeOrderAsync($order, string $contentType = self::contentTypes['placeOrder'][0]) { - return $this->placeOrderAsyncWithHttpInfo($order) + return $this->placeOrderAsyncWithHttpInfo($order, $contentType) ->then( function ($response) { return $response[0]; @@ -1061,14 +1062,15 @@ class StoreApi * Place an order for a pet * * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['placeOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function placeOrderAsyncWithHttpInfo($order) + public function placeOrderAsyncWithHttpInfo($order, string $contentType = self::contentTypes['placeOrder'][0]) { $returnType = '\OpenAPI\Client\Model\Order'; - $request = $this->placeOrderRequest($order); + $request = $this->placeOrderRequest($order, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1110,11 +1112,12 @@ class StoreApi * Create request for operation 'placeOrder' * * @param \OpenAPI\Client\Model\Order $order order placed for purchasing the pet (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['placeOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function placeOrderRequest($order) + public function placeOrderRequest($order, string $contentType = self::contentTypes['placeOrder'][0]) { // verify the required parameter 'order' is set @@ -1124,6 +1127,7 @@ class StoreApi ); } + $resourcePath = '/store/order'; $formParams = []; $queryParams = []; @@ -1135,20 +1139,16 @@ class StoreApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/xml', 'application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($order)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($order)); } else { $httpBody = $order; @@ -1168,9 +1168,9 @@ class StoreApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 10ea5277a9f..387ccc4c890 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -69,7 +69,35 @@ class UserApi */ protected $hostIndex; - /** + /** @var string[] $contentTypes **/ + public const contentTypes = [ + 'createUser' => [ + 'application/json', + ], + 'createUsersWithArrayInput' => [ + 'application/json', + ], + 'createUsersWithListInput' => [ + 'application/json', + ], + 'deleteUser' => [ + 'application/json', + ], + 'getUserByName' => [ + 'application/json', + ], + 'loginUser' => [ + 'application/json', + ], + 'logoutUser' => [ + 'application/json', + ], + 'updateUser' => [ + 'application/json', + ], + ]; + +/** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector @@ -121,14 +149,15 @@ class UserApi * Create user * * @param \OpenAPI\Client\Model\User $user Created user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUser'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function createUser($user) + public function createUser($user, string $contentType = self::contentTypes['createUser'][0]) { - $this->createUserWithHttpInfo($user); + $this->createUserWithHttpInfo($user, $contentType); } /** @@ -137,14 +166,15 @@ class UserApi * Create user * * @param \OpenAPI\Client\Model\User $user Created user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUser'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createUserWithHttpInfo($user) + public function createUserWithHttpInfo($user, string $contentType = self::contentTypes['createUser'][0]) { - $request = $this->createUserRequest($user); + $request = $this->createUserRequest($user, $contentType); try { $options = $this->createHttpClientOption(); @@ -185,7 +215,6 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -197,13 +226,14 @@ class UserApi * Create user * * @param \OpenAPI\Client\Model\User $user Created user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUserAsync($user) + public function createUserAsync($user, string $contentType = self::contentTypes['createUser'][0]) { - return $this->createUserAsyncWithHttpInfo($user) + return $this->createUserAsyncWithHttpInfo($user, $contentType) ->then( function ($response) { return $response[0]; @@ -217,14 +247,15 @@ class UserApi * Create user * * @param \OpenAPI\Client\Model\User $user Created user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUserAsyncWithHttpInfo($user) + public function createUserAsyncWithHttpInfo($user, string $contentType = self::contentTypes['createUser'][0]) { $returnType = ''; - $request = $this->createUserRequest($user); + $request = $this->createUserRequest($user, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -253,11 +284,12 @@ class UserApi * Create request for operation 'createUser' * * @param \OpenAPI\Client\Model\User $user Created user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createUserRequest($user) + public function createUserRequest($user, string $contentType = self::contentTypes['createUser'][0]) { // verify the required parameter 'user' is set @@ -267,6 +299,7 @@ class UserApi ); } + $resourcePath = '/user'; $formParams = []; $queryParams = []; @@ -278,20 +311,16 @@ class UserApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($user)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user)); } else { $httpBody = $user; @@ -311,9 +340,9 @@ class UserApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -348,14 +377,15 @@ class UserApi * Creates list of users with given input array * * @param \OpenAPI\Client\Model\User[] $user List of user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUsersWithArrayInput'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function createUsersWithArrayInput($user) + public function createUsersWithArrayInput($user, string $contentType = self::contentTypes['createUsersWithArrayInput'][0]) { - $this->createUsersWithArrayInputWithHttpInfo($user); + $this->createUsersWithArrayInputWithHttpInfo($user, $contentType); } /** @@ -364,14 +394,15 @@ class UserApi * Creates list of users with given input array * * @param \OpenAPI\Client\Model\User[] $user List of user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUsersWithArrayInput'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createUsersWithArrayInputWithHttpInfo($user) + public function createUsersWithArrayInputWithHttpInfo($user, string $contentType = self::contentTypes['createUsersWithArrayInput'][0]) { - $request = $this->createUsersWithArrayInputRequest($user); + $request = $this->createUsersWithArrayInputRequest($user, $contentType); try { $options = $this->createHttpClientOption(); @@ -412,7 +443,6 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -424,13 +454,14 @@ class UserApi * Creates list of users with given input array * * @param \OpenAPI\Client\Model\User[] $user List of user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUsersWithArrayInput'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUsersWithArrayInputAsync($user) + public function createUsersWithArrayInputAsync($user, string $contentType = self::contentTypes['createUsersWithArrayInput'][0]) { - return $this->createUsersWithArrayInputAsyncWithHttpInfo($user) + return $this->createUsersWithArrayInputAsyncWithHttpInfo($user, $contentType) ->then( function ($response) { return $response[0]; @@ -444,14 +475,15 @@ class UserApi * Creates list of users with given input array * * @param \OpenAPI\Client\Model\User[] $user List of user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUsersWithArrayInput'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUsersWithArrayInputAsyncWithHttpInfo($user) + public function createUsersWithArrayInputAsyncWithHttpInfo($user, string $contentType = self::contentTypes['createUsersWithArrayInput'][0]) { $returnType = ''; - $request = $this->createUsersWithArrayInputRequest($user); + $request = $this->createUsersWithArrayInputRequest($user, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -480,11 +512,12 @@ class UserApi * Create request for operation 'createUsersWithArrayInput' * * @param \OpenAPI\Client\Model\User[] $user List of user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUsersWithArrayInput'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createUsersWithArrayInputRequest($user) + public function createUsersWithArrayInputRequest($user, string $contentType = self::contentTypes['createUsersWithArrayInput'][0]) { // verify the required parameter 'user' is set @@ -494,6 +527,7 @@ class UserApi ); } + $resourcePath = '/user/createWithArray'; $formParams = []; $queryParams = []; @@ -505,20 +539,16 @@ class UserApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($user)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user)); } else { $httpBody = $user; @@ -538,9 +568,9 @@ class UserApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -575,14 +605,15 @@ class UserApi * Creates list of users with given input array * * @param \OpenAPI\Client\Model\User[] $user List of user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUsersWithListInput'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function createUsersWithListInput($user) + public function createUsersWithListInput($user, string $contentType = self::contentTypes['createUsersWithListInput'][0]) { - $this->createUsersWithListInputWithHttpInfo($user); + $this->createUsersWithListInputWithHttpInfo($user, $contentType); } /** @@ -591,14 +622,15 @@ class UserApi * Creates list of users with given input array * * @param \OpenAPI\Client\Model\User[] $user List of user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUsersWithListInput'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createUsersWithListInputWithHttpInfo($user) + public function createUsersWithListInputWithHttpInfo($user, string $contentType = self::contentTypes['createUsersWithListInput'][0]) { - $request = $this->createUsersWithListInputRequest($user); + $request = $this->createUsersWithListInputRequest($user, $contentType); try { $options = $this->createHttpClientOption(); @@ -639,7 +671,6 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -651,13 +682,14 @@ class UserApi * Creates list of users with given input array * * @param \OpenAPI\Client\Model\User[] $user List of user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUsersWithListInput'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUsersWithListInputAsync($user) + public function createUsersWithListInputAsync($user, string $contentType = self::contentTypes['createUsersWithListInput'][0]) { - return $this->createUsersWithListInputAsyncWithHttpInfo($user) + return $this->createUsersWithListInputAsyncWithHttpInfo($user, $contentType) ->then( function ($response) { return $response[0]; @@ -671,14 +703,15 @@ class UserApi * Creates list of users with given input array * * @param \OpenAPI\Client\Model\User[] $user List of user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUsersWithListInput'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createUsersWithListInputAsyncWithHttpInfo($user) + public function createUsersWithListInputAsyncWithHttpInfo($user, string $contentType = self::contentTypes['createUsersWithListInput'][0]) { $returnType = ''; - $request = $this->createUsersWithListInputRequest($user); + $request = $this->createUsersWithListInputRequest($user, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -707,11 +740,12 @@ class UserApi * Create request for operation 'createUsersWithListInput' * * @param \OpenAPI\Client\Model\User[] $user List of user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createUsersWithListInput'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createUsersWithListInputRequest($user) + public function createUsersWithListInputRequest($user, string $contentType = self::contentTypes['createUsersWithListInput'][0]) { // verify the required parameter 'user' is set @@ -721,6 +755,7 @@ class UserApi ); } + $resourcePath = '/user/createWithList'; $formParams = []; $queryParams = []; @@ -732,20 +767,16 @@ class UserApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($user)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user)); } else { $httpBody = $user; @@ -765,9 +796,9 @@ class UserApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -802,14 +833,15 @@ class UserApi * Delete user * * @param string $username The name that needs to be deleted (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteUser'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteUser($username) + public function deleteUser($username, string $contentType = self::contentTypes['deleteUser'][0]) { - $this->deleteUserWithHttpInfo($username); + $this->deleteUserWithHttpInfo($username, $contentType); } /** @@ -818,14 +850,15 @@ class UserApi * Delete user * * @param string $username The name that needs to be deleted (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteUser'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteUserWithHttpInfo($username) + public function deleteUserWithHttpInfo($username, string $contentType = self::contentTypes['deleteUser'][0]) { - $request = $this->deleteUserRequest($username); + $request = $this->deleteUserRequest($username, $contentType); try { $options = $this->createHttpClientOption(); @@ -866,8 +899,6 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { - - } throw $e; } @@ -879,13 +910,14 @@ class UserApi * Delete user * * @param string $username The name that needs to be deleted (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteUserAsync($username) + public function deleteUserAsync($username, string $contentType = self::contentTypes['deleteUser'][0]) { - return $this->deleteUserAsyncWithHttpInfo($username) + return $this->deleteUserAsyncWithHttpInfo($username, $contentType) ->then( function ($response) { return $response[0]; @@ -899,14 +931,15 @@ class UserApi * Delete user * * @param string $username The name that needs to be deleted (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteUserAsyncWithHttpInfo($username) + public function deleteUserAsyncWithHttpInfo($username, string $contentType = self::contentTypes['deleteUser'][0]) { $returnType = ''; - $request = $this->deleteUserRequest($username); + $request = $this->deleteUserRequest($username, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -935,11 +968,12 @@ class UserApi * Create request for operation 'deleteUser' * * @param string $username The name that needs to be deleted (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteUserRequest($username) + public function deleteUserRequest($username, string $contentType = self::contentTypes['deleteUser'][0]) { // verify the required parameter 'username' is set @@ -949,6 +983,7 @@ class UserApi ); } + $resourcePath = '/user/{username}'; $formParams = []; $queryParams = []; @@ -968,16 +1003,11 @@ class UserApi } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -995,9 +1025,9 @@ class UserApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1032,14 +1062,15 @@ class UserApi * Get user by user name * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\User */ - public function getUserByName($username) + public function getUserByName($username, string $contentType = self::contentTypes['getUserByName'][0]) { - list($response) = $this->getUserByNameWithHttpInfo($username); + list($response) = $this->getUserByNameWithHttpInfo($username, $contentType); return $response; } @@ -1049,14 +1080,15 @@ class UserApi * Get user by user name * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserByName'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\User, HTTP status code, HTTP response headers (array of strings) */ - public function getUserByNameWithHttpInfo($username) + public function getUserByNameWithHttpInfo($username, string $contentType = self::contentTypes['getUserByName'][0]) { - $request = $this->getUserByNameRequest($username); + $request = $this->getUserByNameRequest($username, $contentType); try { $options = $this->createHttpClientOption(); @@ -1094,7 +1126,6 @@ class UserApi } switch($statusCode) { - case 200: if ('\OpenAPI\Client\Model\User' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1110,9 +1141,6 @@ class UserApi $response->getStatusCode(), $response->getHeaders() ]; - - - } $returnType = '\OpenAPI\Client\Model\User'; @@ -1133,7 +1161,6 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1142,9 +1169,6 @@ class UserApi ); $e->setResponseObject($data); break; - - - } throw $e; } @@ -1156,13 +1180,14 @@ class UserApi * Get user by user name * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserByNameAsync($username) + public function getUserByNameAsync($username, string $contentType = self::contentTypes['getUserByName'][0]) { - return $this->getUserByNameAsyncWithHttpInfo($username) + return $this->getUserByNameAsyncWithHttpInfo($username, $contentType) ->then( function ($response) { return $response[0]; @@ -1176,14 +1201,15 @@ class UserApi * Get user by user name * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserByNameAsyncWithHttpInfo($username) + public function getUserByNameAsyncWithHttpInfo($username, string $contentType = self::contentTypes['getUserByName'][0]) { $returnType = '\OpenAPI\Client\Model\User'; - $request = $this->getUserByNameRequest($username); + $request = $this->getUserByNameRequest($username, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1225,11 +1251,12 @@ class UserApi * Create request for operation 'getUserByName' * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserByName'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUserByNameRequest($username) + public function getUserByNameRequest($username, string $contentType = self::contentTypes['getUserByName'][0]) { // verify the required parameter 'username' is set @@ -1239,6 +1266,7 @@ class UserApi ); } + $resourcePath = '/user/{username}'; $formParams = []; $queryParams = []; @@ -1258,16 +1286,11 @@ class UserApi } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/xml', 'application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1285,9 +1308,9 @@ class UserApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1323,14 +1346,15 @@ class UserApi * * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginUser'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return string */ - public function loginUser($username, $password) + public function loginUser($username, $password, string $contentType = self::contentTypes['loginUser'][0]) { - list($response) = $this->loginUserWithHttpInfo($username, $password); + list($response) = $this->loginUserWithHttpInfo($username, $password, $contentType); return $response; } @@ -1341,14 +1365,15 @@ class UserApi * * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginUser'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function loginUserWithHttpInfo($username, $password) + public function loginUserWithHttpInfo($username, $password, string $contentType = self::contentTypes['loginUser'][0]) { - $request = $this->loginUserRequest($username, $password); + $request = $this->loginUserRequest($username, $password, $contentType); try { $options = $this->createHttpClientOption(); @@ -1386,7 +1411,6 @@ class UserApi } switch($statusCode) { - case 200: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1402,8 +1426,6 @@ class UserApi $response->getStatusCode(), $response->getHeaders() ]; - - } $returnType = 'string'; @@ -1424,7 +1446,6 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { - case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1433,8 +1454,6 @@ class UserApi ); $e->setResponseObject($data); break; - - } throw $e; } @@ -1447,13 +1466,14 @@ class UserApi * * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function loginUserAsync($username, $password) + public function loginUserAsync($username, $password, string $contentType = self::contentTypes['loginUser'][0]) { - return $this->loginUserAsyncWithHttpInfo($username, $password) + return $this->loginUserAsyncWithHttpInfo($username, $password, $contentType) ->then( function ($response) { return $response[0]; @@ -1468,14 +1488,15 @@ class UserApi * * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function loginUserAsyncWithHttpInfo($username, $password) + public function loginUserAsyncWithHttpInfo($username, $password, string $contentType = self::contentTypes['loginUser'][0]) { $returnType = 'string'; - $request = $this->loginUserRequest($username, $password); + $request = $this->loginUserRequest($username, $password, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1518,11 +1539,12 @@ class UserApi * * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function loginUserRequest($username, $password) + public function loginUserRequest($username, $password, string $contentType = self::contentTypes['loginUser'][0]) { // verify the required parameter 'username' is set @@ -1539,6 +1561,7 @@ class UserApi ); } + $resourcePath = '/user/login'; $formParams = []; $queryParams = []; @@ -1568,16 +1591,11 @@ class UserApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/xml', 'application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/xml', 'application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1595,9 +1613,9 @@ class UserApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1631,14 +1649,15 @@ class UserApi * * Logs out current logged in user session * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logoutUser'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function logoutUser() + public function logoutUser(string $contentType = self::contentTypes['logoutUser'][0]) { - $this->logoutUserWithHttpInfo(); + $this->logoutUserWithHttpInfo($contentType); } /** @@ -1646,14 +1665,15 @@ class UserApi * * Logs out current logged in user session * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logoutUser'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function logoutUserWithHttpInfo() + public function logoutUserWithHttpInfo(string $contentType = self::contentTypes['logoutUser'][0]) { - $request = $this->logoutUserRequest(); + $request = $this->logoutUserRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -1694,7 +1714,6 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { - } throw $e; } @@ -1705,13 +1724,14 @@ class UserApi * * Logs out current logged in user session * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logoutUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function logoutUserAsync() + public function logoutUserAsync(string $contentType = self::contentTypes['logoutUser'][0]) { - return $this->logoutUserAsyncWithHttpInfo() + return $this->logoutUserAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -1724,14 +1744,15 @@ class UserApi * * Logs out current logged in user session * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logoutUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function logoutUserAsyncWithHttpInfo() + public function logoutUserAsyncWithHttpInfo(string $contentType = self::contentTypes['logoutUser'][0]) { $returnType = ''; - $request = $this->logoutUserRequest(); + $request = $this->logoutUserRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1759,13 +1780,15 @@ class UserApi /** * Create request for operation 'logoutUser' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logoutUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function logoutUserRequest() + public function logoutUserRequest(string $contentType = self::contentTypes['logoutUser'][0]) { + $resourcePath = '/user/logout'; $formParams = []; $queryParams = []; @@ -1777,16 +1800,11 @@ class UserApi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1804,9 +1822,9 @@ class UserApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); @@ -1842,14 +1860,15 @@ class UserApi * * @param string $username name that need to be deleted (required) * @param \OpenAPI\Client\Model\User $user Updated user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateUser'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function updateUser($username, $user) + public function updateUser($username, $user, string $contentType = self::contentTypes['updateUser'][0]) { - $this->updateUserWithHttpInfo($username, $user); + $this->updateUserWithHttpInfo($username, $user, $contentType); } /** @@ -1859,14 +1878,15 @@ class UserApi * * @param string $username name that need to be deleted (required) * @param \OpenAPI\Client\Model\User $user Updated user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateUser'] to see the possible values for this operation * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updateUserWithHttpInfo($username, $user) + public function updateUserWithHttpInfo($username, $user, string $contentType = self::contentTypes['updateUser'][0]) { - $request = $this->updateUserRequest($username, $user); + $request = $this->updateUserRequest($username, $user, $contentType); try { $options = $this->createHttpClientOption(); @@ -1907,8 +1927,6 @@ class UserApi } catch (ApiException $e) { switch ($e->getCode()) { - - } throw $e; } @@ -1921,13 +1939,14 @@ class UserApi * * @param string $username name that need to be deleted (required) * @param \OpenAPI\Client\Model\User $user Updated user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateUserAsync($username, $user) + public function updateUserAsync($username, $user, string $contentType = self::contentTypes['updateUser'][0]) { - return $this->updateUserAsyncWithHttpInfo($username, $user) + return $this->updateUserAsyncWithHttpInfo($username, $user, $contentType) ->then( function ($response) { return $response[0]; @@ -1942,14 +1961,15 @@ class UserApi * * @param string $username name that need to be deleted (required) * @param \OpenAPI\Client\Model\User $user Updated user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateUserAsyncWithHttpInfo($username, $user) + public function updateUserAsyncWithHttpInfo($username, $user, string $contentType = self::contentTypes['updateUser'][0]) { $returnType = ''; - $request = $this->updateUserRequest($username, $user); + $request = $this->updateUserRequest($username, $user, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1979,11 +1999,12 @@ class UserApi * * @param string $username name that need to be deleted (required) * @param \OpenAPI\Client\Model\User $user Updated user object (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateUser'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateUserRequest($username, $user) + public function updateUserRequest($username, $user, string $contentType = self::contentTypes['updateUser'][0]) { // verify the required parameter 'username' is set @@ -2000,6 +2021,7 @@ class UserApi ); } + $resourcePath = '/user/{username}'; $formParams = []; $queryParams = []; @@ -2019,20 +2041,16 @@ class UserApi } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); // for model (json/xml) if (isset($user)) { - if ($headers['Content-Type'] === 'application/json') { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($user)); } else { $httpBody = $user; @@ -2052,9 +2070,9 @@ class UserApi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index b408f06563b..9d61303a98e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -1,6 +1,6 @@ selectContentTypeHeader($contentTypes); + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } + + $headers['Content-Type'] = $contentType; + } + return $headers; } /** - * @param string[] $accept - * @return array - */ - public function selectHeadersForMultipart($accept) - { - $headers = $this->selectHeaders($accept, []); - - unset($headers['Content-Type']); - return $headers; - } - - /** - * Return the header 'Accept' based on an array of Accept provided + * Return the header 'Accept' based on an array of Accept provided. * * @param string[] $accept Array of header * * @return null|string Accept (e.g. application/json) */ - private function selectAcceptHeader($accept) + private function selectAcceptHeader(array $accept): ?string { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + # filter out empty entries + $accept = array_filter($accept); + + if (count($accept) === 0) { return null; - } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { - return implode(',', $jsonAccept); - } else { + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + if (count($headersWithJson) === 0) { return implode(',', $accept); } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); } /** - * Return the content type based on an array of content-type provided - * - * @param string[] $contentType Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - private function selectContentTypeHeader($contentType) + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { - return 'application/json'; - } else { - return implode(',', $contentType); + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); + } + + /** + * Given an Accept header, returns an associative array splitting the header and its weight + * + * @param string $header "Accept" Header + * + * @return array with the header and its weight + */ + private function getHeaderAndWeight(string $header): array + { + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; + } else { + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; + } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; + } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php index 6dd19a675f6..f5c804b8e3b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php @@ -1,58 +1,163 @@ selectHeaders([ - 'application/xml', - 'application/json' - ], []); - $this->assertSame('application/json', $headers['Accept']); - $headers = $selector->selectHeaders([], []); - $this->assertArrayNotHasKey('Accept', $headers); - - $header = $selector->selectHeaders([ - 'application/yaml', - 'application/xml' - ], []); - $this->assertSame('application/yaml,application/xml', $header['Accept']); - - // test selectHeaderContentType - $headers = $selector->selectHeaders([], [ - 'application/xml', - 'application/json' - ]); - $this->assertSame('application/json', $headers['Content-Type']); - - $headers = $selector->selectHeaders([], []); - $this->assertSame('application/json', $headers['Content-Type']); - $headers = $selector->selectHeaders([], [ - 'application/yaml', - 'application/xml' - ]); - $this->assertSame('application/yaml,application/xml', $headers['Content-Type']); + $headers = $selector->selectHeaders($accept, $contentType, $isMultiple); + $this->assertEquals($expectedHeaders, $headers); } - public function testSelectingHeadersForMultipartBody() + /** + * @return array[][] + */ + public function headersProvider(): array { - // test selectHeaderAccept - $selector = new HeaderSelector(); - $headers = $selector->selectHeadersForMultipart([ - 'application/xml', - 'application/json' - ]); - $this->assertSame('application/json', $headers['Accept']); - $this->assertArrayNotHasKey('Content-Type', $headers); + $data = [ + // array $accept, string $contentType, bool $isMultipart, array $expectedHeaders + [ + # No Accept, Content-Type + [], 'application/xml', false, ['Content-Type' => 'application/xml'], + ], + [ + # No Accept, Content-Type, multipart + [], 'application/xml', true, [], + ], + [ + # single Accept, no Content-Type + ['application/xml'], '', false, ['Accept' => 'application/xml', 'Content-Type' => 'application/json'], + ], + [ + # single Accept, no Content-Type, multipart + ['application/xml'], '', true, ['Accept' => 'application/xml'], + ], + [ + # single Accept, Content-Type + ['application/xml'], 'application/xml', false, ['Accept' => 'application/xml', 'Content-Type' => 'application/xml'], + ], + [ + # single Accept, Content-Type, multipart + ['application/xml'], 'application/xml', true, ['Accept' => 'application/xml'], + ], + [ + # single Accept with parameters, Content-Type with parameters + ['application/json;format=flowed'], 'text/plain;format=fixed', false, ['Accept' => 'application/json;format=flowed', 'Content-Type' => 'text/plain;format=fixed'], + ], - $headers = $selector->selectHeadersForMultipart([]); - $this->assertArrayNotHasKey('Accept', $headers); - $this->assertArrayNotHasKey('Content-Type', $headers); + # Tests for Accept headers - no change on Content-Type or multipart setting + [ + # Multiple Accept without Json + ['application/xml', 'text/html'], '', true, ['Accept' => 'application/xml,text/html'], + ], + [ + # Multiple Accept with application/json + ['application/json', 'text/html'], '', true, ['Accept' => 'application/json,text/html;q=0.9'], + ], + [ + # Multiple Accept with json-like + ['text/html', 'application/xml+json'], '', true, ['Accept' => 'application/xml+json,text/html;q=0.9'], + ], + [ + # Multiple Accept with application/json and json-like + ['text/html', 'application/json', 'application/xml+json'], '', true, ['Accept' => 'application/json,application/xml+json;q=0.9,text/html;q=0.8'], + ], + [ + # Multiple Accept, changing priority to application/json + ['application/xml', 'application/json;q=0.9', 'text/plain;format=flowed;q=0.8'], '', true, ['Accept' => 'application/json,application/xml;q=0.9,text/plain;format=flowed;q=0.8'], + ], + [ + # Multiple Accept, same priority for two headers, one being application/json + ['application/xml', 'application/json', 'text/plain;format=flowed;q=0.9'], '', true, ['Accept' => 'application/json,application/xml;q=0.9,text/plain;format=flowed;q=0.8'], + ], + [ + # Multiple Accept, same priority for two headers, both being application/json + ['application/json', 'application/json;IEEE754Compatible=true', 'text/plain;format=flowed;q=0.9'], '', true, ['Accept' => 'application/json,application/json;IEEE754Compatible=true,text/plain;format=flowed;q=0.9'], + ], + [ + # Multiple Accept, same priority for three headers, two being application/json, with changing priority + ['application/json;q=0.9', 'application/json;IEEE754Compatible=true;q=0.9', 'application/xml', 'text/plain;format=flowed;q=0.9'], '', true, ['Accept' => 'application/json,application/json;IEEE754Compatible=true,application/xml;q=0.9,text/plain;format=flowed;q=0.8'], + ], + ]; + + # More than 28 Accept headers + $data[] = $this->createTestDataForLargeNumberOfAcceptHeaders(30); + + # More than 1000 Accept headers + $data[] = $this->createTestDataForLargeNumberOfAcceptHeaders(1000); + + return $data; + } + + /** + * @param int $numberOfHeaders + * @return array + */ + private function createTestDataForLargeNumberOfAcceptHeaders(int $numberOfHeaders): array + { + $acceptHeaders = ['application/json;q=0.9']; + $expected = ['application/json']; + for ($i=1; $i<$numberOfHeaders; $i++) { + $q = rtrim(sprintf('%0.3f', (1000 - $i) / 1000), '0'); + $acceptHeaders[] = "application/xml;option=$i;q=$q"; + $expected[] = "application/xml;option=$i;q=$q"; + } + + return [ + $acceptHeaders, + '', + true, + ['Accept' => implode(',', $expected)] + ]; + } + + /** + * @dataProvider nextWeightProvider + * @param int $currentWeight + * @param bool $bHasMoreThan28Headers + * @param int $expected + */ + public function testGetNextWeight(int $currentWeight, bool $bHasMoreThan28Headers, int $expected): void + { + $selector = new HeaderSelector(); + + self::assertEquals($expected, $selector->getNextWeight($currentWeight, $bHasMoreThan28Headers)); + } + + public function nextWeightProvider(): array + { + return [ + [1000, true, 999], + [999, true, 998], + [2, true, 1], + [1, true, 1], + [1000, false, 900], + [900, false, 800], + [200, false, 100], + [100, false, 90], + [90, false, 80], + [20, false, 10], + [10, false, 9], + [9, false, 8], + [2, false, 1], + [1, false, 1], + [0, false, 1], + ]; } } diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES index 6ebb4efdd0e..eeea90f1b1c 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES @@ -7,6 +7,7 @@ docs/ApiResponse.md docs/Baz.md docs/Category.md docs/FakeApi.md +docs/OptionalTesting.md docs/Order.md docs/Pet.md docs/PetApi.md @@ -35,6 +36,7 @@ src/models/baz.rs src/models/category.rs src/models/mod.rs src/models/model_return.rs +src/models/optional_testing.rs src/models/order.rs src/models/pet.rs src/models/property_test.rs diff --git a/samples/client/petstore/rust/hyper/petstore/Cargo.toml b/samples/client/petstore/rust/hyper/petstore/Cargo.toml index daaad97bf86..46601e7408e 100644 --- a/samples/client/petstore/rust/hyper/petstore/Cargo.toml +++ b/samples/client/petstore/rust/hyper/petstore/Cargo.toml @@ -2,20 +2,19 @@ name = "petstore-hyper" version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] +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" edition = "2018" [dependencies] serde = "^1.0" serde_derive = "^1.0" +serde_with = "^2.0" serde_json = "^1.0" url = "^2.2" uuid = { version = "^1.0", features = ["serde"] } hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" http = "~0.2" -serde_yaml = "0.7" base64 = "~0.7.0" futures = "^0.3" - -[dev-dependencies] -tokio-core = "*" diff --git a/samples/client/petstore/rust/hyper/petstore/README.md b/samples/client/petstore/rust/hyper/petstore/README.md index 29c034e6f69..f92feb9d9f6 100644 --- a/samples/client/petstore/rust/hyper/petstore/README.md +++ b/samples/client/petstore/rust/hyper/petstore/README.md @@ -56,6 +56,7 @@ Class | Method | HTTP request | Description - [ApiResponse](docs/ApiResponse.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [OptionalTesting](docs/OptionalTesting.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) - [PropertyTest](docs/PropertyTest.md) diff --git a/samples/client/petstore/rust/hyper/petstore/docs/OptionalTesting.md b/samples/client/petstore/rust/hyper/petstore/docs/OptionalTesting.md new file mode 100644 index 00000000000..029e38eb977 --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/docs/OptionalTesting.md @@ -0,0 +1,14 @@ +# OptionalTesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**optional_nonnull** | Option<**String**> | | [optional] +**required_nonnull** | **String** | | +**optional_nullable** | Option<**String**> | | [optional] +**required_nullable** | Option<**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/rust/hyper/petstore/src/models/mod.rs b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs index af4630c6a26..c528fd499bd 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/mod.rs @@ -6,6 +6,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod optional_testing; +pub use self::optional_testing::OptionalTesting; pub mod order; pub use self::order::Order; pub mod pet; diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs new file mode 100644 index 00000000000..f966470fbce --- /dev/null +++ b/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// OptionalTesting : Test handling of optional and nullable fields + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OptionalTesting { + #[serde(rename = "optional_nonnull", skip_serializing_if = "Option::is_none")] + pub optional_nonnull: Option, + #[serde(rename = "required_nonnull")] + pub required_nonnull: String, + #[serde(rename = "optional_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub optional_nullable: Option>, + #[serde(rename = "required_nullable", deserialize_with = "Option::deserialize")] + pub required_nullable: Option, +} + +impl OptionalTesting { + /// Test handling of optional and nullable fields + pub fn new(required_nonnull: String, required_nullable: Option) -> OptionalTesting { + OptionalTesting { + optional_nonnull: None, + required_nonnull, + optional_nullable: None, + required_nullable, + } + } +} + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES index 6a0f473de45..4b2347f5e64 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/FILES @@ -7,6 +7,7 @@ docs/ApiResponse.md docs/Baz.md docs/Category.md docs/FakeApi.md +docs/OptionalTesting.md docs/Order.md docs/Pet.md docs/PetApi.md @@ -33,6 +34,7 @@ src/models/baz.rs src/models/category.rs src/models/mod.rs src/models/model_return.rs +src/models/optional_testing.rs src/models/order.rs src/models/pet.rs src/models/property_test.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml index 5902f2f8900..5bae0367117 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml @@ -2,16 +2,17 @@ name = "petstore-reqwest-async" version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] +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" edition = "2018" [dependencies] serde = "^1.0" serde_derive = "^1.0" +serde_with = "^2.0" serde_json = "^1.0" url = "^2.2" uuid = { version = "^1.0", features = ["serde"] } [dependencies.reqwest] version = "^0.11" features = ["json", "multipart"] - -[dev-dependencies] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/README.md b/samples/client/petstore/rust/reqwest/petstore-async/README.md index e17c4105c17..0d2259c258c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/README.md @@ -56,6 +56,7 @@ Class | Method | HTTP request | Description - [ApiResponse](docs/ApiResponse.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [OptionalTesting](docs/OptionalTesting.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) - [PropertyTest](docs/PropertyTest.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/OptionalTesting.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/OptionalTesting.md new file mode 100644 index 00000000000..029e38eb977 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/OptionalTesting.md @@ -0,0 +1,14 @@ +# OptionalTesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**optional_nonnull** | Option<**String**> | | [optional] +**required_nonnull** | **String** | | +**optional_nullable** | Option<**String**> | | [optional] +**required_nullable** | Option<**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/rust/reqwest/petstore-async/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs index af4630c6a26..c528fd499bd 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/mod.rs @@ -6,6 +6,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod optional_testing; +pub use self::optional_testing::OptionalTesting; pub mod order; pub use self::order::Order; pub mod pet; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs new file mode 100644 index 00000000000..f966470fbce --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// OptionalTesting : Test handling of optional and nullable fields + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OptionalTesting { + #[serde(rename = "optional_nonnull", skip_serializing_if = "Option::is_none")] + pub optional_nonnull: Option, + #[serde(rename = "required_nonnull")] + pub required_nonnull: String, + #[serde(rename = "optional_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub optional_nullable: Option>, + #[serde(rename = "required_nullable", deserialize_with = "Option::deserialize")] + pub required_nullable: Option, +} + +impl OptionalTesting { + /// Test handling of optional and nullable fields + pub fn new(required_nonnull: String, required_nullable: Option) -> OptionalTesting { + OptionalTesting { + optional_nonnull: None, + required_nonnull, + optional_nullable: None, + required_nullable, + } + } +} + + diff --git a/samples/client/petstore/rust/reqwest/petstore-async/tests/pet_tests.rs b/samples/client/petstore/rust/reqwest/petstore-async/tests/pet_tests.rs index 8d9d2576f92..8ab1927deaf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/tests/pet_tests.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/tests/pet_tests.rs @@ -3,7 +3,7 @@ extern crate petstore_reqwest_async; //use petstore_reqwest_async::apis::PetApiClient; use petstore_reqwest_async::apis::configuration; //use petstore_reqwest::apis::PetApiUpdatePetWithFormParams; -use petstore_reqwest_async::models::{Pet}; +use petstore_reqwest_async::models::Pet; use std::option::Option; #[test] @@ -16,16 +16,12 @@ fn test_pet() { let mut new_pet = Pet::new("Rust Pet".to_string(), photo_urls); new_pet.id = Option::Some(8787); - let new_pet_params = petstore_reqwest_async::apis::pet_api::AddPetParams { - pet: new_pet, - }; + let new_pet_params = petstore_reqwest_async::apis::pet_api::AddPetParams { pet: new_pet }; // add pet let _add_result = petstore_reqwest_async::apis::pet_api::add_pet(&config, new_pet_params); - let get_pet_params = petstore_reqwest_async::apis::pet_api::GetPetByIdParams { - pet_id: 8787, - }; + let get_pet_params = petstore_reqwest_async::apis::pet_api::GetPetByIdParams { pet_id: 8787 }; // get pet let _pet_result = petstore_reqwest_async::apis::pet_api::get_pet_by_id(&config, get_pet_params); diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES index 6a0f473de45..4b2347f5e64 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/.openapi-generator/FILES @@ -7,6 +7,7 @@ docs/ApiResponse.md docs/Baz.md docs/Category.md docs/FakeApi.md +docs/OptionalTesting.md docs/Order.md docs/Pet.md docs/PetApi.md @@ -33,6 +34,7 @@ src/models/baz.rs src/models/category.rs src/models/mod.rs src/models/model_return.rs +src/models/optional_testing.rs src/models/order.rs src/models/pet.rs src/models/property_test.rs diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml index 112dcce90da..beef9b801cf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml @@ -2,11 +2,14 @@ name = "petstore-reqwest-awsv4signature" version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] +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" edition = "2018" [dependencies] serde = "^1.0" serde_derive = "^1.0" +serde_with = "^2.0" serde_json = "^1.0" url = "^2.2" uuid = { version = "^1.0", features = ["serde"] } @@ -14,5 +17,3 @@ aws-sigv4 = "0.3.0" http = "0.2.5" secrecy = "0.8.0" reqwest = "~0.9" - -[dev-dependencies] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md index 8520ca9d803..6aa08b5fdf6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/README.md @@ -56,6 +56,7 @@ Class | Method | HTTP request | Description - [ApiResponse](docs/ApiResponse.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [OptionalTesting](docs/OptionalTesting.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) - [PropertyTest](docs/PropertyTest.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/OptionalTesting.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/OptionalTesting.md new file mode 100644 index 00000000000..029e38eb977 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/OptionalTesting.md @@ -0,0 +1,14 @@ +# OptionalTesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**optional_nonnull** | Option<**String**> | | [optional] +**required_nonnull** | **String** | | +**optional_nullable** | Option<**String**> | | [optional] +**required_nullable** | Option<**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/rust/reqwest/petstore-awsv4signature/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs index af4630c6a26..c528fd499bd 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/mod.rs @@ -6,6 +6,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod optional_testing; +pub use self::optional_testing::OptionalTesting; pub mod order; pub use self::order::Order; pub mod pet; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs new file mode 100644 index 00000000000..f966470fbce --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// OptionalTesting : Test handling of optional and nullable fields + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OptionalTesting { + #[serde(rename = "optional_nonnull", skip_serializing_if = "Option::is_none")] + pub optional_nonnull: Option, + #[serde(rename = "required_nonnull")] + pub required_nonnull: String, + #[serde(rename = "optional_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub optional_nullable: Option>, + #[serde(rename = "required_nullable", deserialize_with = "Option::deserialize")] + pub required_nullable: Option, +} + +impl OptionalTesting { + /// Test handling of optional and nullable fields + pub fn new(required_nonnull: String, required_nullable: Option) -> OptionalTesting { + OptionalTesting { + optional_nonnull: None, + required_nonnull, + optional_nullable: None, + required_nullable, + } + } +} + + diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES index 6a0f473de45..4b2347f5e64 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/FILES @@ -7,6 +7,7 @@ docs/ApiResponse.md docs/Baz.md docs/Category.md docs/FakeApi.md +docs/OptionalTesting.md docs/Order.md docs/Pet.md docs/PetApi.md @@ -33,6 +34,7 @@ src/models/baz.rs src/models/category.rs src/models/mod.rs src/models/model_return.rs +src/models/optional_testing.rs src/models/order.rs src/models/pet.rs src/models/property_test.rs diff --git a/samples/client/petstore/rust/reqwest/petstore/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore/Cargo.toml index a815e8f2f2f..ca255dfed88 100644 --- a/samples/client/petstore/rust/reqwest/petstore/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore/Cargo.toml @@ -2,14 +2,15 @@ name = "petstore-reqwest" version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] +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" edition = "2018" [dependencies] serde = "^1.0" serde_derive = "^1.0" +serde_with = "^2.0" serde_json = "^1.0" url = "^2.2" uuid = { version = "^1.0", features = ["serde"] } reqwest = "~0.9" - -[dev-dependencies] diff --git a/samples/client/petstore/rust/reqwest/petstore/README.md b/samples/client/petstore/rust/reqwest/petstore/README.md index 962cac9c971..8f11cb347dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore/README.md +++ b/samples/client/petstore/rust/reqwest/petstore/README.md @@ -56,6 +56,7 @@ Class | Method | HTTP request | Description - [ApiResponse](docs/ApiResponse.md) - [Baz](docs/Baz.md) - [Category](docs/Category.md) + - [OptionalTesting](docs/OptionalTesting.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) - [PropertyTest](docs/PropertyTest.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/OptionalTesting.md b/samples/client/petstore/rust/reqwest/petstore/docs/OptionalTesting.md new file mode 100644 index 00000000000..029e38eb977 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/docs/OptionalTesting.md @@ -0,0 +1,14 @@ +# OptionalTesting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**optional_nonnull** | Option<**String**> | | [optional] +**required_nonnull** | **String** | | +**optional_nullable** | Option<**String**> | | [optional] +**required_nullable** | Option<**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/rust/reqwest/petstore/src/models/mod.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs index af4630c6a26..c528fd499bd 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/mod.rs @@ -6,6 +6,8 @@ pub mod baz; pub use self::baz::Baz; pub mod category; pub use self::category::Category; +pub mod optional_testing; +pub use self::optional_testing::OptionalTesting; pub mod order; pub use self::order::Order; pub mod pet; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs new file mode 100644 index 00000000000..f966470fbce --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +/// OptionalTesting : Test handling of optional and nullable fields + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OptionalTesting { + #[serde(rename = "optional_nonnull", skip_serializing_if = "Option::is_none")] + pub optional_nonnull: Option, + #[serde(rename = "required_nonnull")] + pub required_nonnull: String, + #[serde(rename = "optional_nullable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub optional_nullable: Option>, + #[serde(rename = "required_nullable", deserialize_with = "Option::deserialize")] + pub required_nullable: Option, +} + +impl OptionalTesting { + /// Test handling of optional and nullable fields + pub fn new(required_nonnull: String, required_nullable: Option) -> OptionalTesting { + OptionalTesting { + optional_nonnull: None, + required_nonnull, + optional_nullable: None, + required_nullable, + } + } +} + + diff --git a/samples/client/petstore/rust/reqwest/petstore/tests/optional_tests.rs b/samples/client/petstore/rust/reqwest/petstore/tests/optional_tests.rs new file mode 100644 index 00000000000..3ae39aef6b2 --- /dev/null +++ b/samples/client/petstore/rust/reqwest/petstore/tests/optional_tests.rs @@ -0,0 +1,58 @@ +extern crate petstore_reqwest; + +use petstore_reqwest::models::OptionalTesting; + +#[test] +fn test_serialization() { + let mut test = OptionalTesting { + optional_nonnull: None, + required_nonnull: "".to_string(), + optional_nullable: None, + required_nullable: None, + }; + // Only the required fields should show up in JSON + assert_eq!( + serde_json::to_string(&test).unwrap(), + "{\"required_nonnull\":\"\",\"required_nullable\":null}" + ); + // Setting the outer of `optional_nullable` it should be serialized as null + test.optional_nullable = Some(None); + assert_eq!( + serde_json::to_string(&test).unwrap(), + "{\"required_nonnull\":\"\",\"optional_nullable\":null,\"required_nullable\":null}" + ); +} + +#[test] +fn test_deserialization() { + // `required_nullable` is missing so should fail to deserialize + let input = "{\"required_nonnull\": \"\"}"; + assert!(serde_json::from_str::(&input).is_err()); + + // After adding `required_nullable` it should deserialize + // `optional_nullable` should be None because it is not present + let input = "{\"required_nonnull\": \"\", \"required_nullable\": null}"; + let out = serde_json::from_str::(&input).unwrap(); + assert!(out.required_nullable.is_none()); + assert!(out.optional_nullable.is_none()); + + // Setting `optional_nullable` to null should be Some(None) + let input = + "{\"required_nonnull\": \"\", \"required_nullable\": null, \"optional_nullable\": null}"; + assert!(matches!( + serde_json::from_str::(&input) + .unwrap() + .optional_nullable, + Some(None) + )); + + // Setting `optional_nullable` to a value + let input = + "{\"required_nonnull\": \"\", \"required_nullable\": null, \"optional_nullable\": \"abc\"}"; + assert!(matches!( + serde_json::from_str::(&input) + .unwrap() + .optional_nullable, + Some(Some(_)) + )); +} diff --git a/samples/client/petstore/rust/reqwest/petstore/tests/pet_tests.rs b/samples/client/petstore/rust/reqwest/petstore/tests/pet_tests.rs index 9a1e00a70a2..fd49b3d2d4f 100644 --- a/samples/client/petstore/rust/reqwest/petstore/tests/pet_tests.rs +++ b/samples/client/petstore/rust/reqwest/petstore/tests/pet_tests.rs @@ -1,8 +1,8 @@ extern crate petstore_reqwest; -use petstore_reqwest::apis::pet_api::{add_pet, get_pet_by_id}; use petstore_reqwest::apis::configuration; -use petstore_reqwest::models::{Pet}; +use petstore_reqwest::apis::pet_api::{add_pet, get_pet_by_id}; +use petstore_reqwest::models::Pet; #[test] fn test_pet() { @@ -24,7 +24,10 @@ fn test_pet() { /* Test code when multiple returns option is not set. */ assert_eq!(resp.id, Option::Some(8787)); assert_eq!(resp.name, "Rust Pet"); - assert_eq!(resp.photo_urls, vec!["https://11".to_string(), "https://22".to_string()]); + assert_eq!( + resp.photo_urls, + vec!["https://11".to_string(), "https://22".to_string()] + ); /* Test code for multiple returns option. match resp.entity { Some(petstore_reqwest::apis::pet_api::GetPetByIdSuccess::Status200(pet)) => { @@ -37,10 +40,10 @@ fn test_pet() { }, }; */ - }, + } Err(error) => { println!("error: {:?}", error); panic!("Query should succeed"); - }, + } }; } diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index 5410bdc1938..8b46211dc20 100644 --- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "Default", description = "the Default API") -@RequestMapping("${openapi.apiDocumentation.base-path:}") public interface DefaultApi { /** diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApiClient.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApiClient.java index f80fe4ddc67..ed3b67c359a 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApiClient.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApiClient.java @@ -3,6 +3,6 @@ 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) +@FeignClient(name="${pet.name:pet}", configuration = ClientConfiguration.class) public interface PetApiClient extends PetApi { } diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApiClient.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApiClient.java index 71d613a871d..b49ab7583f2 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApiClient.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApiClient.java @@ -3,6 +3,6 @@ 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) +@FeignClient(name="${store.name:store}", configuration = ClientConfiguration.class) public interface StoreApiClient extends StoreApi { } diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApiClient.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApiClient.java index 1db4598108d..ecbe88a3b9d 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApiClient.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApiClient.java @@ -3,6 +3,6 @@ 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) +@FeignClient(name="${user.name:user}", configuration = ClientConfiguration.class) public interface UserApiClient extends UserApi { } 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 cca25bd21cb..04cb4f94cd7 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { 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 cbae0bc962c..99991b9321a 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 @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { diff --git a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts index faf417ca720..2fea248ca7a 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { diff --git a/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts b/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts index aa6210e3820..0f47ce36bac 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { 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 faf417ca720..2fea248ca7a 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 @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { 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 faf417ca720..2fea248ca7a 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { 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 faf417ca720..2fea248ca7a 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 @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { 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 faf417ca720..2fea248ca7a 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 @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { 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 faf417ca720..2fea248ca7a 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { 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 faf417ca720..2fea248ca7a 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 @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { 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 aa6210e3820..0f47ce36bac 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 @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -335,7 +335,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { 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 13991f0072d..80892c61073 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 @@ -152,7 +152,7 @@ export class BaseAPI { init: initParams, context, })) - } + }; const init: RequestInit = { ...overridedInit, @@ -226,11 +226,11 @@ export class BaseAPI { }; function isBlob(value: any): value is Blob { - return typeof Blob !== 'undefined' && value instanceof Blob + return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData + return typeof FormData !== "undefined" && value instanceof FormData; } export class ResponseError extends Error { @@ -268,7 +268,7 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody } +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise @@ -325,7 +325,7 @@ export function canConsumeForm(consumes: Consume[]): boolean { } export interface Consume { - contentType: string + contentType: string; } export interface RequestContext { diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py index dfbf6822aa2..6fa884fc7d8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py @@ -297,7 +297,7 @@ class StyleFormSerializer(ParameterSerializerBase): prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> str: if prefix_separator_iterator is None: - prefix_separator_iterator = PrefixSeparatorIterator('?', '&') + prefix_separator_iterator = PrefixSeparatorIterator('', '&') return self._ref6570_expansion( variable_name=name, in_data=in_data, @@ -1462,7 +1462,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=False) + value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) return dict(body=value) def serialize( diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py index a26ef4d234b..69c763dcab0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForCon @typing.overload def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi index d1507bf9f24..2a5e71e5e09 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForCon @typing.overload def post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py index dbe7ce6e679..0ef020fde52 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes(Bas @typing.overload def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi index c248434a477..328985f0eed 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_are_allowed_by_default_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes(Bas @typing.overload def post_additionalproperties_are_allowed_by_default_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py index a4195f8bec5..39b07dfedb0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes(BaseAp @typing.overload def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi index 82150f4679c..02d57121925 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_can_exist_by_itself_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes(BaseAp @typing.overload def post_additionalproperties_can_exist_by_itself_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py index 3783c4bff5d..08339309f7a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTy @typing.overload def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi index 901c227bbb0..11163b1c9ed 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAdditionalpropertiesShouldNotLookInApplicatorsResponseBodyForContentTy @typing.overload def post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py index ea702207499..8d431a16108 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_combined_with_anyof_oneof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi index 966c85fbffb..a5da83b5659 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_combined_with_anyof_oneof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAllofCombinedWithAnyofOneofResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_combined_with_anyof_oneof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py index 4c7e1485151..f6c037767dd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAllofResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi index 983e72c0242..07ec804e206 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAllofResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py index 04dc25c28db..77f0a396a21 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_simple_types_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAllofSimpleTypesResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_simple_types_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi index 17fb582dc3f..9a539d77891 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_simple_types_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAllofSimpleTypesResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_simple_types_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py index e0ec00ff541..419a5d97d3e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_base_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAllofWithBaseSchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_with_base_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi index 203f7e98338..2e942812df7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_base_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAllofWithBaseSchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_with_base_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py index db5c47fe161..84a474e909a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_one_empty_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAllofWithOneEmptySchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_with_one_empty_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi index 6458869c87e..6b727ad4f8a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_one_empty_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAllofWithOneEmptySchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_with_one_empty_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py index 1cc370ae259..ef1b3dbf401 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_with_the_first_empty_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi index 885e09eaa56..ced149513ab 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_first_empty_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAllofWithTheFirstEmptySchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_with_the_first_empty_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py index 8e550c0e2a1..4abb4c3a69d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_with_the_last_empty_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi index 7ce32b96232..19ed64f5a35 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_the_last_empty_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAllofWithTheLastEmptySchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_with_the_last_empty_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py index a8336a12848..b59cf91ebb5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAllofWithTwoEmptySchemasResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_with_two_empty_schemas_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi index ad1d6400634..5df855bcae2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_allof_with_two_empty_schemas_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAllofWithTwoEmptySchemasResponseBodyForContentTypes(BaseApi): @typing.overload def post_allof_with_two_empty_schemas_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py index 61104a1a4b7..4b50280b15c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_complex_types_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAnyofComplexTypesResponseBodyForContentTypes(BaseApi): @typing.overload def post_anyof_complex_types_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi index 686b9db9f72..3403a986260 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_complex_types_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAnyofComplexTypesResponseBodyForContentTypes(BaseApi): @typing.overload def post_anyof_complex_types_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py index 4f1056d49ae..0da1f065b45 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAnyofResponseBodyForContentTypes(BaseApi): @typing.overload def post_anyof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi index d95e2fb2699..8dfc9079cbd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAnyofResponseBodyForContentTypes(BaseApi): @typing.overload def post_anyof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py index cb7e1a5bdb0..9eed10462f2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_base_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAnyofWithBaseSchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_anyof_with_base_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi index 4a1ef408783..b4114d66b96 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_base_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAnyofWithBaseSchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_anyof_with_base_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py index dc5293f4aa8..041597c8842 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostAnyofWithOneEmptySchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_anyof_with_one_empty_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi index 2937f62ea24..449cf2d063b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_anyof_with_one_empty_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostAnyofWithOneEmptySchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_anyof_with_one_empty_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py index 5cc8abd84ad..3f8cbfe27e6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_array_type_matches_arrays_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostArrayTypeMatchesArraysResponseBodyForContentTypes(BaseApi): @typing.overload def post_array_type_matches_arrays_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi index de0a2d58659..6a639977786 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_array_type_matches_arrays_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostArrayTypeMatchesArraysResponseBodyForContentTypes(BaseApi): @typing.overload def post_array_type_matches_arrays_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py index db449dae16c..030b06a8e41 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.py @@ -69,6 +69,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_boolean_type_matches_booleans_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -146,6 +147,7 @@ class PostBooleanTypeMatchesBooleansResponseBodyForContentTypes(BaseApi): @typing.overload def post_boolean_type_matches_booleans_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -195,6 +197,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi index 8a82428ed25..8dd6262f62a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post.pyi @@ -64,6 +64,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_boolean_type_matches_booleans_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -141,6 +142,7 @@ class PostBooleanTypeMatchesBooleansResponseBodyForContentTypes(BaseApi): @typing.overload def post_boolean_type_matches_booleans_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -190,6 +192,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py index 7b335897403..7062ed0200e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_int_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostByIntResponseBodyForContentTypes(BaseApi): @typing.overload def post_by_int_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi index ddbd6265458..9a7bbae9361 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_int_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostByIntResponseBodyForContentTypes(BaseApi): @typing.overload def post_by_int_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py index 5ca4e97bda4..f6af5664d40 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_number_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostByNumberResponseBodyForContentTypes(BaseApi): @typing.overload def post_by_number_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi index 3b889482a1b..974ac449f05 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_number_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostByNumberResponseBodyForContentTypes(BaseApi): @typing.overload def post_by_number_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py index 919173804ef..b76bb8fbb9c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_small_number_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostBySmallNumberResponseBodyForContentTypes(BaseApi): @typing.overload def post_by_small_number_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi index 624538655e4..ae36ecd550b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_by_small_number_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostBySmallNumberResponseBodyForContentTypes(BaseApi): @typing.overload def post_by_small_number_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py index 76717401070..d1eff06e693 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.py @@ -92,6 +92,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_date_time_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -169,6 +170,7 @@ class PostDateTimeFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_date_time_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -218,6 +220,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi index af7e94cd9ac..c05db7d83da 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post.pyi @@ -87,6 +87,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_date_time_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -164,6 +165,7 @@ class PostDateTimeFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_date_time_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -213,6 +215,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py index 84ceb9f8533..852d0ec405d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.py @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_email_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,6 +169,7 @@ class PostEmailFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_email_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi index 873bf916764..dfa5becb7a4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post.pyi @@ -86,6 +86,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_email_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -163,6 +164,7 @@ class PostEmailFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_email_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -212,6 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py index b5b4c1392aa..fcaf9122bb2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes(BaseApi): @typing.overload def post_enum_with0_does_not_match_false_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi index 3bafefb7aac..b6dd3e24153 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with0_does_not_match_false_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostEnumWith0DoesNotMatchFalseResponseBodyForContentTypes(BaseApi): @typing.overload def post_enum_with0_does_not_match_false_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py index 2b2e15e491a..cf06ad29bef 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes(BaseApi): @typing.overload def post_enum_with1_does_not_match_true_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi index 207a6acb0c4..3e102004f87 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with1_does_not_match_true_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostEnumWith1DoesNotMatchTrueResponseBodyForContentTypes(BaseApi): @typing.overload def post_enum_with1_does_not_match_true_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py index c3a46becdda..77cceb12c89 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_escaped_characters_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostEnumWithEscapedCharactersResponseBodyForContentTypes(BaseApi): @typing.overload def post_enum_with_escaped_characters_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi index 1f98603a736..87ba64d4570 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_escaped_characters_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostEnumWithEscapedCharactersResponseBodyForContentTypes(BaseApi): @typing.overload def post_enum_with_escaped_characters_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py index 7230c68ea2b..7b99febc2d9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes(BaseApi): @typing.overload def post_enum_with_false_does_not_match0_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi index 8c5611e6ecd..6456036913a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_false_does_not_match0_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostEnumWithFalseDoesNotMatch0ResponseBodyForContentTypes(BaseApi): @typing.overload def post_enum_with_false_does_not_match0_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py index fef0e8c61e7..bf9c1ba2b10 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes(BaseApi): @typing.overload def post_enum_with_true_does_not_match1_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi index fdcec3d0b31..89feb1f1b64 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enum_with_true_does_not_match1_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostEnumWithTrueDoesNotMatch1ResponseBodyForContentTypes(BaseApi): @typing.overload def post_enum_with_true_does_not_match1_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py index ad9d8983425..189a0b705df 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enums_in_properties_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostEnumsInPropertiesResponseBodyForContentTypes(BaseApi): @typing.overload def post_enums_in_properties_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi index f3e7352a9d7..4a050af8446 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_enums_in_properties_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostEnumsInPropertiesResponseBodyForContentTypes(BaseApi): @typing.overload def post_enums_in_properties_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py index 0d7ba92648f..e2b09aead36 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_forbidden_property_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostForbiddenPropertyResponseBodyForContentTypes(BaseApi): @typing.overload def post_forbidden_property_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi index fdb543ed0c2..1b146acdf45 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_forbidden_property_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostForbiddenPropertyResponseBodyForContentTypes(BaseApi): @typing.overload def post_forbidden_property_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py index db717448660..1eb11280971 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.py @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_hostname_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,6 +169,7 @@ class PostHostnameFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_hostname_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi index 5e743f86d85..3695f168ccf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post.pyi @@ -86,6 +86,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_hostname_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -163,6 +164,7 @@ class PostHostnameFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_hostname_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -212,6 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py index 9c89b09ba74..1ed8a0920d9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.py @@ -69,6 +69,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_integer_type_matches_integers_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -146,6 +147,7 @@ class PostIntegerTypeMatchesIntegersResponseBodyForContentTypes(BaseApi): @typing.overload def post_integer_type_matches_integers_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -195,6 +197,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi index d8c15f8b3e1..b00b5c5ec8d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post.pyi @@ -64,6 +64,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_integer_type_matches_integers_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -141,6 +142,7 @@ class PostIntegerTypeMatchesIntegersResponseBodyForContentTypes(BaseApi): @typing.overload def post_integer_type_matches_integers_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -190,6 +192,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py index 42efb7a3b98..6fe5816765a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForC @typing.overload def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi index e9a1d5381c3..d9e3618aad8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInfResponseBodyForC @typing.overload def post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py index 3efddb842f9..39b0069e770 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_string_value_for_default_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostInvalidStringValueForDefaultResponseBodyForContentTypes(BaseApi): @typing.overload def post_invalid_string_value_for_default_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi index 3ddd4b967da..c568b3e1302 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_invalid_string_value_for_default_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostInvalidStringValueForDefaultResponseBodyForContentTypes(BaseApi): @typing.overload def post_invalid_string_value_for_default_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py index 3a909408c19..deb135e6eb7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.py @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv4_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,6 +169,7 @@ class PostIpv4FormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_ipv4_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi index c33a67b7687..7c0f7f47cb8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post.pyi @@ -86,6 +86,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv4_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -163,6 +164,7 @@ class PostIpv4FormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_ipv4_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -212,6 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py index 50675e49758..3aa10226b8d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.py @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv6_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,6 +169,7 @@ class PostIpv6FormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_ipv6_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi index 671be4e1b40..54392bcfc37 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post.pyi @@ -86,6 +86,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ipv6_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -163,6 +164,7 @@ class PostIpv6FormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_ipv6_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -212,6 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py index e14fec5a329..c50bd665461 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.py @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_json_pointer_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,6 +169,7 @@ class PostJsonPointerFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_json_pointer_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi index b15178f375e..93604bb85ca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post.pyi @@ -86,6 +86,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_json_pointer_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -163,6 +164,7 @@ class PostJsonPointerFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_json_pointer_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -212,6 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py index 014815369da..51dcc488a82 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMaximumValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_maximum_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi index 67f10e833cb..38c1592d8b7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMaximumValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_maximum_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py index 2d6a599008a..b17d7e4eb7a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes(BaseAp @typing.overload def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi index 7dc51f79d71..39239b266b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maximum_validation_with_unsigned_integer_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMaximumValidationWithUnsignedIntegerResponseBodyForContentTypes(BaseAp @typing.overload def post_maximum_validation_with_unsigned_integer_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py index 49228378831..131755c3710 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxitems_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMaxitemsValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_maxitems_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi index 7976bfe5b8c..4b232322037 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxitems_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMaxitemsValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_maxitems_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py index 857194aeddd..12c48c612be 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxlength_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMaxlengthValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_maxlength_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi index 722b3231719..67a49cfb35e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxlength_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMaxlengthValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_maxlength_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py index 2f1fe908a90..fe39361d422 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes(BaseApi @typing.overload def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi index 906b57dca17..816491bd56c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties0_means_the_object_is_empty_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMaxproperties0MeansTheObjectIsEmptyResponseBodyForContentTypes(BaseApi @typing.overload def post_maxproperties0_means_the_object_is_empty_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py index caef224ec89..61ec66dfc04 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMaxpropertiesValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_maxproperties_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi index a12bafc0241..acad9a85a92 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_maxproperties_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMaxpropertiesValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_maxproperties_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py index 455b40680e6..e6df6196f60 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMinimumValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_minimum_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi index 3ecf130dc09..482781d5794 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMinimumValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_minimum_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py index c7dbae7b649..e929dbcee32 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes(BaseApi) @typing.overload def post_minimum_validation_with_signed_integer_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi index 4a94bf8db0d..850526fae3e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minimum_validation_with_signed_integer_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMinimumValidationWithSignedIntegerResponseBodyForContentTypes(BaseApi) @typing.overload def post_minimum_validation_with_signed_integer_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py index 05ed4ee8bb9..df08580e42e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minitems_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMinitemsValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_minitems_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi index c9e8bb7a6f0..73f91144425 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minitems_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMinitemsValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_minitems_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py index fd1d4f2d1a7..df932cb5f10 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minlength_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMinlengthValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_minlength_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi index a67f5177d9c..8779b7b9b11 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minlength_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMinlengthValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_minlength_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py index 7fe9a3c69b5..fa20a29c541 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minproperties_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostMinpropertiesValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_minproperties_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi index 9684d044456..62b2572fd5a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_minproperties_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostMinpropertiesValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_minproperties_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py index e29ea0fbc53..373e7db540a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes(BaseA @typing.overload def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi index 4810724d1d9..99c4c8f7244 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_allof_to_check_validation_semantics_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostNestedAllofToCheckValidationSemanticsResponseBodyForContentTypes(BaseA @typing.overload def post_nested_allof_to_check_validation_semantics_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py index 3489d664010..94d61d9b79e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes(BaseA @typing.overload def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi index 80692348d73..96c083c4b94 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_anyof_to_check_validation_semantics_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostNestedAnyofToCheckValidationSemanticsResponseBodyForContentTypes(BaseA @typing.overload def post_nested_anyof_to_check_validation_semantics_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py index 492ff134548..3bfe474ceba 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_items_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostNestedItemsResponseBodyForContentTypes(BaseApi): @typing.overload def post_nested_items_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi index df06609b95b..2869480c1d8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_items_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostNestedItemsResponseBodyForContentTypes(BaseApi): @typing.overload def post_nested_items_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py index d4e48876658..00dba053a14 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes(BaseA @typing.overload def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi index 7d498d603bf..014f023fa6e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nested_oneof_to_check_validation_semantics_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes(BaseA @typing.overload def post_nested_oneof_to_check_validation_semantics_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py index 6bc017808ff..9cf3c05972a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.py @@ -140,6 +140,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_more_complex_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +218,7 @@ class PostNotMoreComplexSchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_not_more_complex_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -266,6 +268,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi index 3957b33cb1e..dba719e1352 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post.pyi @@ -135,6 +135,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_more_complex_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -212,6 +213,7 @@ class PostNotMoreComplexSchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_not_more_complex_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -261,6 +263,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py index 03d9ffcda13..9c464a7df41 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.py @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,6 +169,7 @@ class PostNotResponseBodyForContentTypes(BaseApi): @typing.overload def post_not_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi index 7b2fa049cad..b3fc90331f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post.pyi @@ -86,6 +86,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_not_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -163,6 +164,7 @@ class PostNotResponseBodyForContentTypes(BaseApi): @typing.overload def post_not_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -212,6 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py index 8337995803a..51c0a38e329 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nul_characters_in_strings_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostNulCharactersInStringsResponseBodyForContentTypes(BaseApi): @typing.overload def post_nul_characters_in_strings_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi index 017495d5d2d..fd0d333919d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_nul_characters_in_strings_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostNulCharactersInStringsResponseBodyForContentTypes(BaseApi): @typing.overload def post_nul_characters_in_strings_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py index 3ad92b9b8fd..c1e7d374a25 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.py @@ -69,6 +69,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -146,6 +147,7 @@ class PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes(BaseApi): @typing.overload def post_null_type_matches_only_the_null_object_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -195,6 +197,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi index 199f916cee0..f8ec2c324da 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post.pyi @@ -64,6 +64,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_null_type_matches_only_the_null_object_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -141,6 +142,7 @@ class PostNullTypeMatchesOnlyTheNullObjectResponseBodyForContentTypes(BaseApi): @typing.overload def post_null_type_matches_only_the_null_object_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -190,6 +192,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py index cde93c72ce8..361775d9d41 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.py @@ -69,6 +69,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_number_type_matches_numbers_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -146,6 +147,7 @@ class PostNumberTypeMatchesNumbersResponseBodyForContentTypes(BaseApi): @typing.overload def post_number_type_matches_numbers_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -195,6 +197,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi index 6e88c42dd67..3c6fcf2bdb4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post.pyi @@ -64,6 +64,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_number_type_matches_numbers_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -141,6 +142,7 @@ class PostNumberTypeMatchesNumbersResponseBodyForContentTypes(BaseApi): @typing.overload def post_number_type_matches_numbers_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -190,6 +192,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py index e5e9f0db802..4769ba021d8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_properties_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostObjectPropertiesValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_object_properties_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi index 47259e1d4e8..ba651953142 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_properties_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostObjectPropertiesValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_object_properties_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py index 4637ea3d380..40644049039 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.py @@ -69,6 +69,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_type_matches_objects_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -146,6 +147,7 @@ class PostObjectTypeMatchesObjectsResponseBodyForContentTypes(BaseApi): @typing.overload def post_object_type_matches_objects_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -195,6 +197,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi index 5c554c8ce2e..a536bf84d02 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post.pyi @@ -64,6 +64,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_object_type_matches_objects_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -141,6 +142,7 @@ class PostObjectTypeMatchesObjectsResponseBodyForContentTypes(BaseApi): @typing.overload def post_object_type_matches_objects_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -190,6 +192,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py index 0670aeb2be1..ab4917e7cb1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_complex_types_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostOneofComplexTypesResponseBodyForContentTypes(BaseApi): @typing.overload def post_oneof_complex_types_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi index a3801d37e45..13fc378b54c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_complex_types_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostOneofComplexTypesResponseBodyForContentTypes(BaseApi): @typing.overload def post_oneof_complex_types_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py index 473bcca1fe8..a109b7c7af2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostOneofResponseBodyForContentTypes(BaseApi): @typing.overload def post_oneof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi index ef5fdf6e1c0..63bc2cb122f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostOneofResponseBodyForContentTypes(BaseApi): @typing.overload def post_oneof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py index ad589370336..1dfca4c3938 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_base_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostOneofWithBaseSchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_oneof_with_base_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi index 95e8f8bff40..086dd1a6e3d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_base_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostOneofWithBaseSchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_oneof_with_base_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py index a2936bd0d66..d91a02eeb70 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_empty_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostOneofWithEmptySchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_oneof_with_empty_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi index de60f66e0b5..db4e55b94fc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_empty_schema_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostOneofWithEmptySchemaResponseBodyForContentTypes(BaseApi): @typing.overload def post_oneof_with_empty_schema_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py index a05894d4011..18af4cfe7b0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_required_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostOneofWithRequiredResponseBodyForContentTypes(BaseApi): @typing.overload def post_oneof_with_required_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi index f48e1c66e4b..f90b79612ce 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_oneof_with_required_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostOneofWithRequiredResponseBodyForContentTypes(BaseApi): @typing.overload def post_oneof_with_required_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py index e1274eb0039..bef8879c1d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_is_not_anchored_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostPatternIsNotAnchoredResponseBodyForContentTypes(BaseApi): @typing.overload def post_pattern_is_not_anchored_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi index 128e1246fff..c1cc91c88ca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_is_not_anchored_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostPatternIsNotAnchoredResponseBodyForContentTypes(BaseApi): @typing.overload def post_pattern_is_not_anchored_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py index a12b35e1675..f267935d147 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostPatternValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_pattern_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi index 2e1b4cbec54..589121a113c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_pattern_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostPatternValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_pattern_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py index 936ad666576..8bf1bdca885 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_properties_with_escaped_characters_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostPropertiesWithEscapedCharactersResponseBodyForContentTypes(BaseApi): @typing.overload def post_properties_with_escaped_characters_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi index 7e41369c861..a2f57446fd3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_properties_with_escaped_characters_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostPropertiesWithEscapedCharactersResponseBodyForContentTypes(BaseApi): @typing.overload def post_properties_with_escaped_characters_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py index d05ed431c86..7bd5d81fe11 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes(BaseApi @typing.overload def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi index 8bb97630bc7..e6c1333f5c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_property_named_ref_that_is_not_a_reference_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostPropertyNamedRefThatIsNotAReferenceResponseBodyForContentTypes(BaseApi @typing.overload def post_property_named_ref_that_is_not_a_reference_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py index a91f8813a7b..e7d5c5eca61 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_additionalproperties_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostRefInAdditionalpropertiesResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_additionalproperties_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi index 900f5554218..0bb91ff44c1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_additionalproperties_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostRefInAdditionalpropertiesResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_additionalproperties_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py index fcae793b616..cd8bf5b5070 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_allof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostRefInAllofResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_allof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi index 265a672db3c..211f9ff8d28 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_allof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostRefInAllofResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_allof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py index 8e4026bb2fd..c28733f77b3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_anyof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostRefInAnyofResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_anyof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi index a2d53f3dad4..2fbc6af0e12 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_anyof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostRefInAnyofResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_anyof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py index d6faf25623c..77c23bc9faf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_items_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostRefInItemsResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_items_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi index 7ac9c2f3dcb..eab5a6d5a4e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_items_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostRefInItemsResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_items_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py index d289f34e4c4..b4c707bd61b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.py @@ -96,6 +96,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_not_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -173,6 +174,7 @@ class PostRefInNotResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_not_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -222,6 +224,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi index 3b8376118f2..33edd4ec972 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post.pyi @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_not_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,6 +169,7 @@ class PostRefInNotResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_not_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py index c4173c7164b..2ed178a49d9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_oneof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostRefInOneofResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_oneof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi index 78aec765441..53f46629860 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_oneof_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostRefInOneofResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_oneof_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py index 8c919aea71c..ed51fd0f79b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_property_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostRefInPropertyResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_property_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi index 87b6d585960..974eb70c891 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_ref_in_property_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostRefInPropertyResponseBodyForContentTypes(BaseApi): @typing.overload def post_ref_in_property_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py index 2f071fcad98..2c1e9db6462 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_default_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostRequiredDefaultValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_required_default_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi index ba9ce4b930f..977571b091f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_default_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostRequiredDefaultValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_required_default_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py index feece12371f..d30d66adfde 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostRequiredValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_required_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi index 0c226b3e2e7..17454c7031c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostRequiredValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_required_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py index ae3f890c1b0..c951da515a9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_empty_array_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostRequiredWithEmptyArrayResponseBodyForContentTypes(BaseApi): @typing.overload def post_required_with_empty_array_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi index 550654feff6..3c36cc22f5c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_empty_array_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostRequiredWithEmptyArrayResponseBodyForContentTypes(BaseApi): @typing.overload def post_required_with_empty_array_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py index 837f66395ac..7745f092fb1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.py @@ -99,6 +99,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_escaped_characters_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -176,6 +177,7 @@ class PostRequiredWithEscapedCharactersResponseBodyForContentTypes(BaseApi): @typing.overload def post_required_with_escaped_characters_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -225,6 +227,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi index 38ff81848c9..654dea6b470 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post.pyi @@ -94,6 +94,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_required_with_escaped_characters_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,6 +172,7 @@ class PostRequiredWithEscapedCharactersResponseBodyForContentTypes(BaseApi): @typing.overload def post_required_with_escaped_characters_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -220,6 +222,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py index f33666b2d9b..98f48905197 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_simple_enum_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostSimpleEnumValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_simple_enum_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi index 525cc8b4279..e8cbae9b39c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_simple_enum_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostSimpleEnumValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_simple_enum_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py index 232e64e2fd7..690aca6f91d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.py @@ -69,6 +69,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_string_type_matches_strings_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -146,6 +147,7 @@ class PostStringTypeMatchesStringsResponseBodyForContentTypes(BaseApi): @typing.overload def post_string_type_matches_strings_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -195,6 +197,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi index 92cb39e7f99..54bc07baa99 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post.pyi @@ -64,6 +64,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_string_type_matches_strings_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -141,6 +142,7 @@ class PostStringTypeMatchesStringsResponseBodyForContentTypes(BaseApi): @typing.overload def post_string_type_matches_strings_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -190,6 +192,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py index 7ec32ffcd59..f84c021f89f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyFo @typing.overload def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi index 5e4fef20acd..12593d9a33c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyFo @typing.overload def post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py index 2ca6488bc1a..6c00ce1445f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_false_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostUniqueitemsFalseValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_uniqueitems_false_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi index 3054b495166..c38e6e9c334 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_false_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostUniqueitemsFalseValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_uniqueitems_false_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py index c4f75d43a8a..b8c53f797bd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class PostUniqueitemsValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_uniqueitems_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi index b8d23d3e76e..5d7a775bebc 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uniqueitems_validation_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class PostUniqueitemsValidationResponseBodyForContentTypes(BaseApi): @typing.overload def post_uniqueitems_validation_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py index b0bb6afea94..5049eb56e95 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.py @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,6 +169,7 @@ class PostUriFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_uri_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi index aec6e6c16f0..119a9678d7b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post.pyi @@ -86,6 +86,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -163,6 +164,7 @@ class PostUriFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_uri_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -212,6 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py index b0f93102472..65ecca6b552 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.py @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_reference_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,6 +169,7 @@ class PostUriReferenceFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_uri_reference_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi index 3de5191676e..985665f5486 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post.pyi @@ -86,6 +86,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_reference_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -163,6 +164,7 @@ class PostUriReferenceFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_uri_reference_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -212,6 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py index 1eea3901e94..52dcf6763da 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.py @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_template_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -168,6 +169,7 @@ class PostUriTemplateFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_uri_template_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -217,6 +219,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi index 06064e29e7b..7d1760c1b73 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post.pyi @@ -86,6 +86,7 @@ class BaseApi(api_client.Api): @typing.overload def _post_uri_template_format_response_body_for_content_types_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -163,6 +164,7 @@ class PostUriTemplateFormatResponseBodyForContentTypes(BaseApi): @typing.overload def post_uri_template_format_response_body_for_content_types( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -212,6 +214,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/rest.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/rest.py index 75a309eed90..fc2409d3862 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/rest.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/rest.py @@ -146,6 +146,7 @@ class RESTClientObject(object): elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 r = self.pool_manager.request( method, url, + body=body, fields=fields, encode_multipart=False, preload_content=not stream, diff --git a/samples/openapi3/client/elm/src/Api.elm b/samples/openapi3/client/elm/src/Api.elm index 842a33ca3aa..9d6f5de1e7e 100644 --- a/samples/openapi3/client/elm/src/Api.elm +++ b/samples/openapi3/client/elm/src/Api.elm @@ -3,6 +3,7 @@ module Api exposing , request , send , sendWithCustomError + , sendWithCustomExpect , task , map , withBasePath @@ -55,13 +56,18 @@ send toMsg req = sendWithCustomError : (Http.Error -> e) -> (Result e a -> msg) -> Request a -> Cmd msg -sendWithCustomError mapError toMsg (Request req) = +sendWithCustomError mapError toMsg req = + sendWithCustomExpect (expectJson mapError toMsg) req + + +sendWithCustomExpect : (Json.Decode.Decoder a -> Http.Expect msg) -> Request a -> Cmd msg +sendWithCustomExpect expect (Request req) = Http.request { method = req.method , headers = req.headers , url = Url.Builder.crossOrigin req.basePath req.pathParams req.queryParams , body = req.body - , expect = expectJson mapError toMsg req.decoder + , expect = expect req.decoder , timeout = req.timeout , tracker = req.tracker } 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 547180d6b63..7501f465647 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 @@ -120,7 +120,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { // Check the type is as expected. if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) } return nil } @@ -459,7 +459,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e } if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) + err = fmt.Errorf("invalid body type %s\n", contentType) return nil, err } return bodyBuf, nil @@ -561,3 +561,23 @@ func (e GenericOpenAPIError) Body() []byte { func (e GenericOpenAPIError) Model() interface{} { return e.model } + +// format error message using title and detail when model implements rfc7807 +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()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + + // status title (detail) + return fmt.Sprintf("%s %s", status, str) +} diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/configuration.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/configuration.go index 69e73c4ffe0..a8b3ade6ec5 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/configuration.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/configuration.go @@ -156,7 +156,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { // URL formats template on a index using given variables func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) } server := sc[index] url := server.URL @@ -171,7 +171,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri } } if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) } url = strings.Replace(url, "{"+name+"}", value, -1) } else { diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/utils.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/utils.go index 333051f2d09..4cff93795c1 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/utils.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/utils.go @@ -12,6 +12,7 @@ package x_auth_id_alias import ( "encoding/json" + "reflect" "time" ) @@ -326,3 +327,17 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + +// isNil checks if an input is nil +func isNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle index a74a80cb114..d0dbfd5a34f 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle @@ -99,9 +99,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.2" - jackson_databind_version = "2.13.2.2" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "5.8.2" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt index 01f6d20e918..695952a12c5 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt @@ -18,9 +18,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml index 748669225c9..9715e87cb1f 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml @@ -335,9 +335,9 @@ UTF-8 1.6.5 2.35 - 2.13.2 - 2.13.2.2 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 5.8.2 2.21.0 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index b931cc044f9..d52c3115dd0 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -297,7 +297,7 @@ class StyleFormSerializer(ParameterSerializerBase): prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> str: if prefix_separator_iterator is None: - prefix_separator_iterator = PrefixSeparatorIterator('?', '&') + prefix_separator_iterator = PrefixSeparatorIterator('', '&') return self._ref6570_expansion( variable_name=name, in_data=in_data, @@ -1462,7 +1462,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=False) + value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) return dict(body=value) def serialize( diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.py index 593d61673a1..50aed72b00a 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.py @@ -120,6 +120,7 @@ class BaseApi(api_client.Api): @typing.overload def _custom_server_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, host_index: typing.Optional[int] = None, stream: bool = False, @@ -205,6 +206,7 @@ class CustomServer(BaseApi): @typing.overload def custom_server( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, host_index: typing.Optional[int] = None, stream: bool = False, @@ -259,6 +261,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, host_index: typing.Optional[int] = None, stream: bool = False, diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.pyi b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.pyi index 1fd19d9ea6d..4f9da96c6c8 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.pyi +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/custom/get.pyi @@ -65,6 +65,7 @@ class BaseApi(api_client.Api): @typing.overload def _custom_server_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, host_index: typing.Optional[int] = None, stream: bool = False, @@ -150,6 +151,7 @@ class CustomServer(BaseApi): @typing.overload def custom_server( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, host_index: typing.Optional[int] = None, stream: bool = False, @@ -204,6 +206,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, host_index: typing.Optional[int] = None, stream: bool = False, diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.py index a4e2fdce47d..07a1cc5e221 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.py @@ -69,6 +69,7 @@ class BaseApi(api_client.Api): @typing.overload def _default_server_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -147,6 +148,7 @@ class DefaultServer(BaseApi): @typing.overload def default_server( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -196,6 +198,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.pyi b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.pyi index 89e925ed40e..193aadbce29 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.pyi +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/paths/default/get.pyi @@ -64,6 +64,7 @@ class BaseApi(api_client.Api): @typing.overload def _default_server_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -142,6 +143,7 @@ class DefaultServer(BaseApi): @typing.overload def default_server( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -191,6 +193,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py index d1a0e37cb2f..d91b562efa3 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py @@ -146,6 +146,7 @@ class RESTClientObject(object): elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 r = self.pool_manager.request( method, url, + body=body, fields=fields, encode_multipart=False, preload_content=not stream, diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES index 257af3a4dcd..30c2ee9992b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES @@ -62,6 +62,7 @@ docs/NullableClass.md docs/NumberOnly.md docs/OneOfPrimitiveType.md docs/OneOfPrimitiveTypeChild.md +docs/OneOfPrimitiveTypes.md docs/Order.md docs/OuterComposite.md docs/OuterEnum.md @@ -131,6 +132,7 @@ model_nullable_class.go model_number_only.go model_one_of_primitive_type.go model_one_of_primitive_type_child.go +model_one_of_primitive_types.go model_order.go model_outer_composite.go model_outer_enum.go diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index 643757ee605..3d7dd74d300 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -168,6 +168,7 @@ Class | Method | HTTP request | Description - [NumberOnly](docs/NumberOnly.md) - [OneOfPrimitiveType](docs/OneOfPrimitiveType.md) - [OneOfPrimitiveTypeChild](docs/OneOfPrimitiveTypeChild.md) + - [OneOfPrimitiveTypes](docs/OneOfPrimitiveTypes.md) - [Order](docs/Order.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index e198da04056..71097efe090 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -1984,6 +1984,11 @@ components: description: a property to test map of file type: object type: object + OneOfPrimitiveTypes: + oneOf: + - type: string + - format: date-time + type: string _foo_get_default_response: example: string: diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index a025e553800..0a54d9522fa 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -126,7 +126,8 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (*FooGetDefaultRes newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode < 500 { @@ -136,7 +137,8 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (*FooGetDefaultRes newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } var v FooGetDefaultResponse @@ -145,7 +147,8 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (*FooGetDefaultRes newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index 516497d5996..4594645964c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -1666,7 +1666,8 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index c6d7fabcb2e..a573bd4fa89 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -138,7 +138,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { // Check the type is as expected. if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) } return nil } @@ -487,7 +487,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e } if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) + err = fmt.Errorf("invalid body type %s\n", contentType) return nil, err } return bodyBuf, nil @@ -589,3 +589,23 @@ func (e GenericOpenAPIError) Body() []byte { func (e GenericOpenAPIError) Model() interface{} { return e.model } + +// format error message using title and detail when model implements rfc7807 +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()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + + // status title (detail) + return fmt.Sprintf("%s %s", status, str) +} diff --git a/samples/openapi3/client/petstore/go/go-petstore/configuration.go b/samples/openapi3/client/petstore/go/go-petstore/configuration.go index dc41bdcfc29..10c6f27a583 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/configuration.go +++ b/samples/openapi3/client/petstore/go/go-petstore/configuration.go @@ -180,7 +180,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { // URL formats template on a index using given variables func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) } server := sc[index] url := server.URL @@ -195,7 +195,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri } } if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) } url = strings.Replace(url, "{"+name+"}", value, -1) } else { diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/OneOfPrimitiveTypes.md b/samples/openapi3/client/petstore/go/go-petstore/docs/OneOfPrimitiveTypes.md new file mode 100644 index 00000000000..7c86356d85d --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/OneOfPrimitiveTypes.md @@ -0,0 +1,30 @@ +# OneOfPrimitiveTypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewOneOfPrimitiveTypes + +`func NewOneOfPrimitiveTypes() *OneOfPrimitiveTypes` + +NewOneOfPrimitiveTypes instantiates a new OneOfPrimitiveTypes object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOneOfPrimitiveTypesWithDefaults + +`func NewOneOfPrimitiveTypesWithDefaults() *OneOfPrimitiveTypes` + +NewOneOfPrimitiveTypesWithDefaults instantiates a new OneOfPrimitiveTypes object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[[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/go/go-petstore/model_200_response.go b/samples/openapi3/client/petstore/go/go-petstore/model_200_response.go index 27004b3b727..d71fe66e143 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_200_response.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_200_response.go @@ -42,7 +42,7 @@ func NewModel200ResponseWithDefaults() *Model200Response { // GetName returns the Name field value if set, zero value otherwise. func (o *Model200Response) GetName() int32 { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret int32 return ret } @@ -52,15 +52,15 @@ func (o *Model200Response) GetName() int32 { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Model200Response) GetNameOk() (*int32, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *Model200Response) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -74,7 +74,7 @@ func (o *Model200Response) SetName(v int32) { // GetClass returns the Class field value if set, zero value otherwise. func (o *Model200Response) GetClass() string { - if o == nil || o.Class == nil { + if o == nil || isNil(o.Class) { var ret string return ret } @@ -84,15 +84,15 @@ func (o *Model200Response) GetClass() string { // GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Model200Response) GetClassOk() (*string, bool) { - if o == nil || o.Class == nil { - return nil, false + if o == nil || isNil(o.Class) { + return nil, false } return o.Class, true } // HasClass returns a boolean if a field has been set. func (o *Model200Response) HasClass() bool { - if o != nil && o.Class != nil { + if o != nil && !isNil(o.Class) { return true } @@ -106,10 +106,10 @@ func (o *Model200Response) SetClass(v string) { func (o Model200Response) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } - if o.Class != nil { + if !isNil(o.Class) { toSerialize["class"] = o.Class } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model__foo_get_default_response.go b/samples/openapi3/client/petstore/go/go-petstore/model__foo_get_default_response.go index 3bc2b67b72b..af0a9889e8a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model__foo_get_default_response.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model__foo_get_default_response.go @@ -41,7 +41,7 @@ func NewFooGetDefaultResponseWithDefaults() *FooGetDefaultResponse { // GetString returns the String field value if set, zero value otherwise. func (o *FooGetDefaultResponse) GetString() Foo { - if o == nil || o.String == nil { + if o == nil || isNil(o.String) { var ret Foo return ret } @@ -51,15 +51,15 @@ func (o *FooGetDefaultResponse) GetString() Foo { // GetStringOk returns a tuple with the String field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FooGetDefaultResponse) GetStringOk() (*Foo, bool) { - if o == nil || o.String == nil { - return nil, false + if o == nil || isNil(o.String) { + return nil, false } return o.String, true } // HasString returns a boolean if a field has been set. func (o *FooGetDefaultResponse) HasString() bool { - if o != nil && o.String != nil { + if o != nil && !isNil(o.String) { return true } @@ -73,7 +73,7 @@ func (o *FooGetDefaultResponse) SetString(v Foo) { func (o FooGetDefaultResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.String != nil { + if !isNil(o.String) { toSerialize["string"] = o.String } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go b/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go index 9b66df708cb..081d5b1970a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go @@ -41,7 +41,7 @@ func NewSpecialModelNameWithDefaults() *SpecialModelName { // GetSpecialPropertyName returns the SpecialPropertyName field value if set, zero value otherwise. func (o *SpecialModelName) GetSpecialPropertyName() int64 { - if o == nil || o.SpecialPropertyName == nil { + if o == nil || isNil(o.SpecialPropertyName) { var ret int64 return ret } @@ -51,15 +51,15 @@ func (o *SpecialModelName) GetSpecialPropertyName() int64 { // GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SpecialModelName) GetSpecialPropertyNameOk() (*int64, bool) { - if o == nil || o.SpecialPropertyName == nil { - return nil, false + if o == nil || isNil(o.SpecialPropertyName) { + return nil, false } return o.SpecialPropertyName, true } // HasSpecialPropertyName returns a boolean if a field has been set. func (o *SpecialModelName) HasSpecialPropertyName() bool { - if o != nil && o.SpecialPropertyName != nil { + if o != nil && !isNil(o.SpecialPropertyName) { return true } @@ -73,7 +73,7 @@ func (o *SpecialModelName) SetSpecialPropertyName(v int64) { func (o SpecialModelName) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SpecialPropertyName != nil { + if !isNil(o.SpecialPropertyName) { toSerialize["$special[property.name]"] = o.SpecialPropertyName } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go index b7b55a2a983..c0a955ec13a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go @@ -42,7 +42,7 @@ func NewAdditionalPropertiesClassWithDefaults() *AdditionalPropertiesClass { // GetMapProperty returns the MapProperty field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetMapProperty() map[string]string { - if o == nil || o.MapProperty == nil { + if o == nil || isNil(o.MapProperty) { var ret map[string]string return ret } @@ -52,15 +52,15 @@ func (o *AdditionalPropertiesClass) GetMapProperty() map[string]string { // GetMapPropertyOk returns a tuple with the MapProperty field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetMapPropertyOk() (*map[string]string, bool) { - if o == nil || o.MapProperty == nil { - return nil, false + if o == nil || isNil(o.MapProperty) { + return nil, false } return o.MapProperty, true } // HasMapProperty returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasMapProperty() bool { - if o != nil && o.MapProperty != nil { + if o != nil && !isNil(o.MapProperty) { return true } @@ -74,7 +74,7 @@ func (o *AdditionalPropertiesClass) SetMapProperty(v map[string]string) { // GetMapOfMapProperty returns the MapOfMapProperty field value if set, zero value otherwise. func (o *AdditionalPropertiesClass) GetMapOfMapProperty() map[string]map[string]string { - if o == nil || o.MapOfMapProperty == nil { + if o == nil || isNil(o.MapOfMapProperty) { var ret map[string]map[string]string return ret } @@ -84,15 +84,15 @@ func (o *AdditionalPropertiesClass) GetMapOfMapProperty() map[string]map[string] // GetMapOfMapPropertyOk returns a tuple with the MapOfMapProperty field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AdditionalPropertiesClass) GetMapOfMapPropertyOk() (*map[string]map[string]string, bool) { - if o == nil || o.MapOfMapProperty == nil { - return nil, false + if o == nil || isNil(o.MapOfMapProperty) { + return nil, false } return o.MapOfMapProperty, true } // HasMapOfMapProperty returns a boolean if a field has been set. func (o *AdditionalPropertiesClass) HasMapOfMapProperty() bool { - if o != nil && o.MapOfMapProperty != nil { + if o != nil && !isNil(o.MapOfMapProperty) { return true } @@ -106,10 +106,10 @@ func (o *AdditionalPropertiesClass) SetMapOfMapProperty(v map[string]map[string] func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MapProperty != nil { + if !isNil(o.MapProperty) { toSerialize["map_property"] = o.MapProperty } - if o.MapOfMapProperty != nil { + if !isNil(o.MapOfMapProperty) { toSerialize["map_of_map_property"] = o.MapOfMapProperty } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_animal.go b/samples/openapi3/client/petstore/go/go-petstore/model_animal.go index c8bc5e8960e..cc666634936 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_animal.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_animal.go @@ -59,7 +59,7 @@ func (o *Animal) GetClassName() string { // and a boolean to check if the value has been set. func (o *Animal) GetClassNameOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.ClassName, true } @@ -71,7 +71,7 @@ func (o *Animal) SetClassName(v string) { // GetColor returns the Color field value if set, zero value otherwise. func (o *Animal) GetColor() string { - if o == nil || o.Color == nil { + if o == nil || isNil(o.Color) { var ret string return ret } @@ -81,15 +81,15 @@ func (o *Animal) GetColor() string { // GetColorOk returns a tuple with the Color field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Animal) GetColorOk() (*string, bool) { - if o == nil || o.Color == nil { - return nil, false + if o == nil || isNil(o.Color) { + return nil, false } return o.Color, true } // HasColor returns a boolean if a field has been set. func (o *Animal) HasColor() bool { - if o != nil && o.Color != nil { + if o != nil && !isNil(o.Color) { return true } @@ -106,7 +106,7 @@ func (o Animal) MarshalJSON() ([]byte, error) { if true { toSerialize["className"] = o.ClassName } - if o.Color != nil { + if !isNil(o.Color) { toSerialize["color"] = o.Color } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go b/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go index 6ad5fad605a..cbc0cfc691f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go @@ -43,7 +43,7 @@ func NewApiResponseWithDefaults() *ApiResponse { // GetCode returns the Code field value if set, zero value otherwise. func (o *ApiResponse) GetCode() int32 { - if o == nil || o.Code == nil { + if o == nil || isNil(o.Code) { var ret int32 return ret } @@ -53,15 +53,15 @@ func (o *ApiResponse) GetCode() int32 { // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiResponse) GetCodeOk() (*int32, bool) { - if o == nil || o.Code == nil { - return nil, false + if o == nil || isNil(o.Code) { + return nil, false } return o.Code, true } // HasCode returns a boolean if a field has been set. func (o *ApiResponse) HasCode() bool { - if o != nil && o.Code != nil { + if o != nil && !isNil(o.Code) { return true } @@ -75,7 +75,7 @@ func (o *ApiResponse) SetCode(v int32) { // GetType returns the Type field value if set, zero value otherwise. func (o *ApiResponse) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -85,15 +85,15 @@ func (o *ApiResponse) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiResponse) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *ApiResponse) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -107,7 +107,7 @@ func (o *ApiResponse) SetType(v string) { // GetMessage returns the Message field value if set, zero value otherwise. func (o *ApiResponse) GetMessage() string { - if o == nil || o.Message == nil { + if o == nil || isNil(o.Message) { var ret string return ret } @@ -117,15 +117,15 @@ func (o *ApiResponse) GetMessage() string { // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ApiResponse) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false + if o == nil || isNil(o.Message) { + return nil, false } return o.Message, true } // HasMessage returns a boolean if a field has been set. func (o *ApiResponse) HasMessage() bool { - if o != nil && o.Message != nil { + if o != nil && !isNil(o.Message) { return true } @@ -139,13 +139,13 @@ func (o *ApiResponse) SetMessage(v string) { func (o ApiResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Code != nil { + if !isNil(o.Code) { toSerialize["code"] = o.Code } - if o.Type != nil { + if !isNil(o.Type) { toSerialize["type"] = o.Type } - if o.Message != nil { + if !isNil(o.Message) { toSerialize["message"] = o.Message } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_apple.go b/samples/openapi3/client/petstore/go/go-petstore/model_apple.go index 443a333234a..ef09d3d96bb 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_apple.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_apple.go @@ -41,7 +41,7 @@ func NewAppleWithDefaults() *Apple { // GetCultivar returns the Cultivar field value if set, zero value otherwise. func (o *Apple) GetCultivar() string { - if o == nil || o.Cultivar == nil { + if o == nil || isNil(o.Cultivar) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *Apple) GetCultivar() string { // GetCultivarOk returns a tuple with the Cultivar field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Apple) GetCultivarOk() (*string, bool) { - if o == nil || o.Cultivar == nil { - return nil, false + if o == nil || isNil(o.Cultivar) { + return nil, false } return o.Cultivar, true } // HasCultivar returns a boolean if a field has been set. func (o *Apple) HasCultivar() bool { - if o != nil && o.Cultivar != nil { + if o != nil && !isNil(o.Cultivar) { return true } @@ -73,7 +73,7 @@ func (o *Apple) SetCultivar(v string) { func (o Apple) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Cultivar != nil { + if !isNil(o.Cultivar) { toSerialize["cultivar"] = o.Cultivar } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go index f57b7fdf8c8..9dc1e2cca6a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go @@ -55,7 +55,7 @@ func (o *AppleReq) GetCultivar() string { // and a boolean to check if the value has been set. func (o *AppleReq) GetCultivarOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Cultivar, true } @@ -67,7 +67,7 @@ func (o *AppleReq) SetCultivar(v string) { // GetMealy returns the Mealy field value if set, zero value otherwise. func (o *AppleReq) GetMealy() bool { - if o == nil || o.Mealy == nil { + if o == nil || isNil(o.Mealy) { var ret bool return ret } @@ -77,15 +77,15 @@ func (o *AppleReq) GetMealy() bool { // GetMealyOk returns a tuple with the Mealy field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AppleReq) GetMealyOk() (*bool, bool) { - if o == nil || o.Mealy == nil { - return nil, false + if o == nil || isNil(o.Mealy) { + return nil, false } return o.Mealy, true } // HasMealy returns a boolean if a field has been set. func (o *AppleReq) HasMealy() bool { - if o != nil && o.Mealy != nil { + if o != nil && !isNil(o.Mealy) { return true } @@ -102,7 +102,7 @@ func (o AppleReq) MarshalJSON() ([]byte, error) { if true { toSerialize["cultivar"] = o.Cultivar } - if o.Mealy != nil { + if !isNil(o.Mealy) { toSerialize["mealy"] = o.Mealy } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go index 56dcc6c3c94..2e56b7dba7e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go @@ -41,7 +41,7 @@ func NewArrayOfArrayOfNumberOnlyWithDefaults() *ArrayOfArrayOfNumberOnly { // GetArrayArrayNumber returns the ArrayArrayNumber field value if set, zero value otherwise. func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { - if o == nil || o.ArrayArrayNumber == nil { + if o == nil || isNil(o.ArrayArrayNumber) { var ret [][]float32 return ret } @@ -51,15 +51,15 @@ func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { // GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() ([][]float32, bool) { - if o == nil || o.ArrayArrayNumber == nil { - return nil, false + if o == nil || isNil(o.ArrayArrayNumber) { + return nil, false } return o.ArrayArrayNumber, true } // HasArrayArrayNumber returns a boolean if a field has been set. func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool { - if o != nil && o.ArrayArrayNumber != nil { + if o != nil && !isNil(o.ArrayArrayNumber) { return true } @@ -73,7 +73,7 @@ func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ArrayArrayNumber != nil { + if !isNil(o.ArrayArrayNumber) { toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go index 36e967f70a6..e447774dca1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go @@ -41,7 +41,7 @@ func NewArrayOfNumberOnlyWithDefaults() *ArrayOfNumberOnly { // GetArrayNumber returns the ArrayNumber field value if set, zero value otherwise. func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { - if o == nil || o.ArrayNumber == nil { + if o == nil || isNil(o.ArrayNumber) { var ret []float32 return ret } @@ -51,15 +51,15 @@ func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { // GetArrayNumberOk returns a tuple with the ArrayNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ArrayOfNumberOnly) GetArrayNumberOk() ([]float32, bool) { - if o == nil || o.ArrayNumber == nil { - return nil, false + if o == nil || isNil(o.ArrayNumber) { + return nil, false } return o.ArrayNumber, true } // HasArrayNumber returns a boolean if a field has been set. func (o *ArrayOfNumberOnly) HasArrayNumber() bool { - if o != nil && o.ArrayNumber != nil { + if o != nil && !isNil(o.ArrayNumber) { return true } @@ -73,7 +73,7 @@ func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ArrayNumber != nil { + if !isNil(o.ArrayNumber) { toSerialize["ArrayNumber"] = o.ArrayNumber } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go index aa07cef3a3c..ebd6bb0846e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go @@ -43,7 +43,7 @@ func NewArrayTestWithDefaults() *ArrayTest { // GetArrayOfString returns the ArrayOfString field value if set, zero value otherwise. func (o *ArrayTest) GetArrayOfString() []string { - if o == nil || o.ArrayOfString == nil { + if o == nil || isNil(o.ArrayOfString) { var ret []string return ret } @@ -53,15 +53,15 @@ func (o *ArrayTest) GetArrayOfString() []string { // GetArrayOfStringOk returns a tuple with the ArrayOfString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ArrayTest) GetArrayOfStringOk() ([]string, bool) { - if o == nil || o.ArrayOfString == nil { - return nil, false + if o == nil || isNil(o.ArrayOfString) { + return nil, false } return o.ArrayOfString, true } // HasArrayOfString returns a boolean if a field has been set. func (o *ArrayTest) HasArrayOfString() bool { - if o != nil && o.ArrayOfString != nil { + if o != nil && !isNil(o.ArrayOfString) { return true } @@ -75,7 +75,7 @@ func (o *ArrayTest) SetArrayOfString(v []string) { // GetArrayArrayOfInteger returns the ArrayArrayOfInteger field value if set, zero value otherwise. func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { - if o == nil || o.ArrayArrayOfInteger == nil { + if o == nil || isNil(o.ArrayArrayOfInteger) { var ret [][]int64 return ret } @@ -85,15 +85,15 @@ func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { // GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ArrayTest) GetArrayArrayOfIntegerOk() ([][]int64, bool) { - if o == nil || o.ArrayArrayOfInteger == nil { - return nil, false + if o == nil || isNil(o.ArrayArrayOfInteger) { + return nil, false } return o.ArrayArrayOfInteger, true } // HasArrayArrayOfInteger returns a boolean if a field has been set. func (o *ArrayTest) HasArrayArrayOfInteger() bool { - if o != nil && o.ArrayArrayOfInteger != nil { + if o != nil && !isNil(o.ArrayArrayOfInteger) { return true } @@ -107,7 +107,7 @@ func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64) { // GetArrayArrayOfModel returns the ArrayArrayOfModel field value if set, zero value otherwise. func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { - if o == nil || o.ArrayArrayOfModel == nil { + if o == nil || isNil(o.ArrayArrayOfModel) { var ret [][]ReadOnlyFirst return ret } @@ -117,15 +117,15 @@ func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { // GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ArrayTest) GetArrayArrayOfModelOk() ([][]ReadOnlyFirst, bool) { - if o == nil || o.ArrayArrayOfModel == nil { - return nil, false + if o == nil || isNil(o.ArrayArrayOfModel) { + return nil, false } return o.ArrayArrayOfModel, true } // HasArrayArrayOfModel returns a boolean if a field has been set. func (o *ArrayTest) HasArrayArrayOfModel() bool { - if o != nil && o.ArrayArrayOfModel != nil { + if o != nil && !isNil(o.ArrayArrayOfModel) { return true } @@ -139,13 +139,13 @@ func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { func (o ArrayTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.ArrayOfString != nil { + if !isNil(o.ArrayOfString) { toSerialize["array_of_string"] = o.ArrayOfString } - if o.ArrayArrayOfInteger != nil { + if !isNil(o.ArrayArrayOfInteger) { toSerialize["array_array_of_integer"] = o.ArrayArrayOfInteger } - if o.ArrayArrayOfModel != nil { + if !isNil(o.ArrayArrayOfModel) { toSerialize["array_array_of_model"] = o.ArrayArrayOfModel } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_banana.go b/samples/openapi3/client/petstore/go/go-petstore/model_banana.go index bfd1769a6ef..cbfc560ba85 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_banana.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_banana.go @@ -41,7 +41,7 @@ func NewBananaWithDefaults() *Banana { // GetLengthCm returns the LengthCm field value if set, zero value otherwise. func (o *Banana) GetLengthCm() float32 { - if o == nil || o.LengthCm == nil { + if o == nil || isNil(o.LengthCm) { var ret float32 return ret } @@ -51,15 +51,15 @@ func (o *Banana) GetLengthCm() float32 { // GetLengthCmOk returns a tuple with the LengthCm field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Banana) GetLengthCmOk() (*float32, bool) { - if o == nil || o.LengthCm == nil { - return nil, false + if o == nil || isNil(o.LengthCm) { + return nil, false } return o.LengthCm, true } // HasLengthCm returns a boolean if a field has been set. func (o *Banana) HasLengthCm() bool { - if o != nil && o.LengthCm != nil { + if o != nil && !isNil(o.LengthCm) { return true } @@ -73,7 +73,7 @@ func (o *Banana) SetLengthCm(v float32) { func (o Banana) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.LengthCm != nil { + if !isNil(o.LengthCm) { toSerialize["lengthCm"] = o.LengthCm } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go index c36aedfd31f..aad3ba228f3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go @@ -55,7 +55,7 @@ func (o *BananaReq) GetLengthCm() float32 { // and a boolean to check if the value has been set. func (o *BananaReq) GetLengthCmOk() (*float32, bool) { if o == nil { - return nil, false + return nil, false } return &o.LengthCm, true } @@ -67,7 +67,7 @@ func (o *BananaReq) SetLengthCm(v float32) { // GetSweet returns the Sweet field value if set, zero value otherwise. func (o *BananaReq) GetSweet() bool { - if o == nil || o.Sweet == nil { + if o == nil || isNil(o.Sweet) { var ret bool return ret } @@ -77,15 +77,15 @@ func (o *BananaReq) GetSweet() bool { // GetSweetOk returns a tuple with the Sweet field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BananaReq) GetSweetOk() (*bool, bool) { - if o == nil || o.Sweet == nil { - return nil, false + if o == nil || isNil(o.Sweet) { + return nil, false } return o.Sweet, true } // HasSweet returns a boolean if a field has been set. func (o *BananaReq) HasSweet() bool { - if o != nil && o.Sweet != nil { + if o != nil && !isNil(o.Sweet) { return true } @@ -102,7 +102,7 @@ func (o BananaReq) MarshalJSON() ([]byte, error) { if true { toSerialize["lengthCm"] = o.LengthCm } - if o.Sweet != nil { + if !isNil(o.Sweet) { toSerialize["sweet"] = o.Sweet } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go b/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go index 88483e6c6c4..caaf7d1f604 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go @@ -47,7 +47,7 @@ func NewCapitalizationWithDefaults() *Capitalization { // GetSmallCamel returns the SmallCamel field value if set, zero value otherwise. func (o *Capitalization) GetSmallCamel() string { - if o == nil || o.SmallCamel == nil { + if o == nil || isNil(o.SmallCamel) { var ret string return ret } @@ -57,15 +57,15 @@ func (o *Capitalization) GetSmallCamel() string { // GetSmallCamelOk returns a tuple with the SmallCamel field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetSmallCamelOk() (*string, bool) { - if o == nil || o.SmallCamel == nil { - return nil, false + if o == nil || isNil(o.SmallCamel) { + return nil, false } return o.SmallCamel, true } // HasSmallCamel returns a boolean if a field has been set. func (o *Capitalization) HasSmallCamel() bool { - if o != nil && o.SmallCamel != nil { + if o != nil && !isNil(o.SmallCamel) { return true } @@ -79,7 +79,7 @@ func (o *Capitalization) SetSmallCamel(v string) { // GetCapitalCamel returns the CapitalCamel field value if set, zero value otherwise. func (o *Capitalization) GetCapitalCamel() string { - if o == nil || o.CapitalCamel == nil { + if o == nil || isNil(o.CapitalCamel) { var ret string return ret } @@ -89,15 +89,15 @@ func (o *Capitalization) GetCapitalCamel() string { // GetCapitalCamelOk returns a tuple with the CapitalCamel field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetCapitalCamelOk() (*string, bool) { - if o == nil || o.CapitalCamel == nil { - return nil, false + if o == nil || isNil(o.CapitalCamel) { + return nil, false } return o.CapitalCamel, true } // HasCapitalCamel returns a boolean if a field has been set. func (o *Capitalization) HasCapitalCamel() bool { - if o != nil && o.CapitalCamel != nil { + if o != nil && !isNil(o.CapitalCamel) { return true } @@ -111,7 +111,7 @@ func (o *Capitalization) SetCapitalCamel(v string) { // GetSmallSnake returns the SmallSnake field value if set, zero value otherwise. func (o *Capitalization) GetSmallSnake() string { - if o == nil || o.SmallSnake == nil { + if o == nil || isNil(o.SmallSnake) { var ret string return ret } @@ -121,15 +121,15 @@ func (o *Capitalization) GetSmallSnake() string { // GetSmallSnakeOk returns a tuple with the SmallSnake field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetSmallSnakeOk() (*string, bool) { - if o == nil || o.SmallSnake == nil { - return nil, false + if o == nil || isNil(o.SmallSnake) { + return nil, false } return o.SmallSnake, true } // HasSmallSnake returns a boolean if a field has been set. func (o *Capitalization) HasSmallSnake() bool { - if o != nil && o.SmallSnake != nil { + if o != nil && !isNil(o.SmallSnake) { return true } @@ -143,7 +143,7 @@ func (o *Capitalization) SetSmallSnake(v string) { // GetCapitalSnake returns the CapitalSnake field value if set, zero value otherwise. func (o *Capitalization) GetCapitalSnake() string { - if o == nil || o.CapitalSnake == nil { + if o == nil || isNil(o.CapitalSnake) { var ret string return ret } @@ -153,15 +153,15 @@ func (o *Capitalization) GetCapitalSnake() string { // GetCapitalSnakeOk returns a tuple with the CapitalSnake field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetCapitalSnakeOk() (*string, bool) { - if o == nil || o.CapitalSnake == nil { - return nil, false + if o == nil || isNil(o.CapitalSnake) { + return nil, false } return o.CapitalSnake, true } // HasCapitalSnake returns a boolean if a field has been set. func (o *Capitalization) HasCapitalSnake() bool { - if o != nil && o.CapitalSnake != nil { + if o != nil && !isNil(o.CapitalSnake) { return true } @@ -175,7 +175,7 @@ func (o *Capitalization) SetCapitalSnake(v string) { // GetSCAETHFlowPoints returns the SCAETHFlowPoints field value if set, zero value otherwise. func (o *Capitalization) GetSCAETHFlowPoints() string { - if o == nil || o.SCAETHFlowPoints == nil { + if o == nil || isNil(o.SCAETHFlowPoints) { var ret string return ret } @@ -185,15 +185,15 @@ func (o *Capitalization) GetSCAETHFlowPoints() string { // GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetSCAETHFlowPointsOk() (*string, bool) { - if o == nil || o.SCAETHFlowPoints == nil { - return nil, false + if o == nil || isNil(o.SCAETHFlowPoints) { + return nil, false } return o.SCAETHFlowPoints, true } // HasSCAETHFlowPoints returns a boolean if a field has been set. func (o *Capitalization) HasSCAETHFlowPoints() bool { - if o != nil && o.SCAETHFlowPoints != nil { + if o != nil && !isNil(o.SCAETHFlowPoints) { return true } @@ -207,7 +207,7 @@ func (o *Capitalization) SetSCAETHFlowPoints(v string) { // GetATT_NAME returns the ATT_NAME field value if set, zero value otherwise. func (o *Capitalization) GetATT_NAME() string { - if o == nil || o.ATT_NAME == nil { + if o == nil || isNil(o.ATT_NAME) { var ret string return ret } @@ -217,15 +217,15 @@ func (o *Capitalization) GetATT_NAME() string { // GetATT_NAMEOk returns a tuple with the ATT_NAME field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Capitalization) GetATT_NAMEOk() (*string, bool) { - if o == nil || o.ATT_NAME == nil { - return nil, false + if o == nil || isNil(o.ATT_NAME) { + return nil, false } return o.ATT_NAME, true } // HasATT_NAME returns a boolean if a field has been set. func (o *Capitalization) HasATT_NAME() bool { - if o != nil && o.ATT_NAME != nil { + if o != nil && !isNil(o.ATT_NAME) { return true } @@ -239,22 +239,22 @@ func (o *Capitalization) SetATT_NAME(v string) { func (o Capitalization) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SmallCamel != nil { + if !isNil(o.SmallCamel) { toSerialize["smallCamel"] = o.SmallCamel } - if o.CapitalCamel != nil { + if !isNil(o.CapitalCamel) { toSerialize["CapitalCamel"] = o.CapitalCamel } - if o.SmallSnake != nil { + if !isNil(o.SmallSnake) { toSerialize["small_Snake"] = o.SmallSnake } - if o.CapitalSnake != nil { + if !isNil(o.CapitalSnake) { toSerialize["Capital_Snake"] = o.CapitalSnake } - if o.SCAETHFlowPoints != nil { + if !isNil(o.SCAETHFlowPoints) { toSerialize["SCA_ETH_Flow_Points"] = o.SCAETHFlowPoints } - if o.ATT_NAME != nil { + if !isNil(o.ATT_NAME) { toSerialize["ATT_NAME"] = o.ATT_NAME } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_cat.go b/samples/openapi3/client/petstore/go/go-petstore/model_cat.go index 38604e23ea3..7618e4be07a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_cat.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_cat.go @@ -47,7 +47,7 @@ func NewCatWithDefaults() *Cat { // GetDeclawed returns the Declawed field value if set, zero value otherwise. func (o *Cat) GetDeclawed() bool { - if o == nil || o.Declawed == nil { + if o == nil || isNil(o.Declawed) { var ret bool return ret } @@ -57,15 +57,15 @@ func (o *Cat) GetDeclawed() bool { // GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Cat) GetDeclawedOk() (*bool, bool) { - if o == nil || o.Declawed == nil { - return nil, false + if o == nil || isNil(o.Declawed) { + return nil, false } return o.Declawed, true } // HasDeclawed returns a boolean if a field has been set. func (o *Cat) HasDeclawed() bool { - if o != nil && o.Declawed != nil { + if o != nil && !isNil(o.Declawed) { return true } @@ -87,7 +87,7 @@ func (o Cat) MarshalJSON() ([]byte, error) { if errAnimal != nil { return []byte{}, errAnimal } - if o.Declawed != nil { + if !isNil(o.Declawed) { toSerialize["declawed"] = o.Declawed } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go b/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go index 6e9092bd813..c138a3698bf 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go @@ -41,7 +41,7 @@ func NewCatAllOfWithDefaults() *CatAllOf { // GetDeclawed returns the Declawed field value if set, zero value otherwise. func (o *CatAllOf) GetDeclawed() bool { - if o == nil || o.Declawed == nil { + if o == nil || isNil(o.Declawed) { var ret bool return ret } @@ -51,15 +51,15 @@ func (o *CatAllOf) GetDeclawed() bool { // GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CatAllOf) GetDeclawedOk() (*bool, bool) { - if o == nil || o.Declawed == nil { - return nil, false + if o == nil || isNil(o.Declawed) { + return nil, false } return o.Declawed, true } // HasDeclawed returns a boolean if a field has been set. func (o *CatAllOf) HasDeclawed() bool { - if o != nil && o.Declawed != nil { + if o != nil && !isNil(o.Declawed) { return true } @@ -73,7 +73,7 @@ func (o *CatAllOf) SetDeclawed(v bool) { func (o CatAllOf) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Declawed != nil { + if !isNil(o.Declawed) { toSerialize["declawed"] = o.Declawed } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_category.go b/samples/openapi3/client/petstore/go/go-petstore/model_category.go index 124537d152e..14f69aba5e7 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_category.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_category.go @@ -45,7 +45,7 @@ func NewCategoryWithDefaults() *Category { // GetId returns the Id field value if set, zero value otherwise. func (o *Category) GetId() int64 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int64 return ret } @@ -55,15 +55,15 @@ func (o *Category) GetId() int64 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Category) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *Category) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -89,7 +89,7 @@ func (o *Category) GetName() string { // and a boolean to check if the value has been set. func (o *Category) GetNameOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Name, true } @@ -101,7 +101,7 @@ func (o *Category) SetName(v string) { func (o Category) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !isNil(o.Id) { toSerialize["id"] = o.Id } if true { diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go b/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go index 441570be10f..0e655645ed1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go @@ -41,7 +41,7 @@ func NewClassModelWithDefaults() *ClassModel { // GetClass returns the Class field value if set, zero value otherwise. func (o *ClassModel) GetClass() string { - if o == nil || o.Class == nil { + if o == nil || isNil(o.Class) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *ClassModel) GetClass() string { // GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ClassModel) GetClassOk() (*string, bool) { - if o == nil || o.Class == nil { - return nil, false + if o == nil || isNil(o.Class) { + return nil, false } return o.Class, true } // HasClass returns a boolean if a field has been set. func (o *ClassModel) HasClass() bool { - if o != nil && o.Class != nil { + if o != nil && !isNil(o.Class) { return true } @@ -73,7 +73,7 @@ func (o *ClassModel) SetClass(v string) { func (o ClassModel) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Class != nil { + if !isNil(o.Class) { toSerialize["_class"] = o.Class } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_client.go b/samples/openapi3/client/petstore/go/go-petstore/model_client.go index 08274685f07..523123bd38f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_client.go @@ -41,7 +41,7 @@ func NewClientWithDefaults() *Client { // GetClient returns the Client field value if set, zero value otherwise. func (o *Client) GetClient() string { - if o == nil || o.Client == nil { + if o == nil || isNil(o.Client) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *Client) GetClient() string { // GetClientOk returns a tuple with the Client field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Client) GetClientOk() (*string, bool) { - if o == nil || o.Client == nil { - return nil, false + if o == nil || isNil(o.Client) { + return nil, false } return o.Client, true } // HasClient returns a boolean if a field has been set. func (o *Client) HasClient() bool { - if o != nil && o.Client != nil { + if o != nil && !isNil(o.Client) { return true } @@ -73,7 +73,7 @@ func (o *Client) SetClient(v string) { func (o Client) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Client != nil { + if !isNil(o.Client) { toSerialize["client"] = o.Client } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_dog.go b/samples/openapi3/client/petstore/go/go-petstore/model_dog.go index 7dba6c5b5ae..8414fb18f8d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_dog.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_dog.go @@ -47,7 +47,7 @@ func NewDogWithDefaults() *Dog { // GetBreed returns the Breed field value if set, zero value otherwise. func (o *Dog) GetBreed() string { - if o == nil || o.Breed == nil { + if o == nil || isNil(o.Breed) { var ret string return ret } @@ -57,15 +57,15 @@ func (o *Dog) GetBreed() string { // GetBreedOk returns a tuple with the Breed field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Dog) GetBreedOk() (*string, bool) { - if o == nil || o.Breed == nil { - return nil, false + if o == nil || isNil(o.Breed) { + return nil, false } return o.Breed, true } // HasBreed returns a boolean if a field has been set. func (o *Dog) HasBreed() bool { - if o != nil && o.Breed != nil { + if o != nil && !isNil(o.Breed) { return true } @@ -87,7 +87,7 @@ func (o Dog) MarshalJSON() ([]byte, error) { if errAnimal != nil { return []byte{}, errAnimal } - if o.Breed != nil { + if !isNil(o.Breed) { toSerialize["breed"] = o.Breed } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go b/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go index 8a6c06d1000..162bddcfea3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go @@ -41,7 +41,7 @@ func NewDogAllOfWithDefaults() *DogAllOf { // GetBreed returns the Breed field value if set, zero value otherwise. func (o *DogAllOf) GetBreed() string { - if o == nil || o.Breed == nil { + if o == nil || isNil(o.Breed) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *DogAllOf) GetBreed() string { // GetBreedOk returns a tuple with the Breed field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DogAllOf) GetBreedOk() (*string, bool) { - if o == nil || o.Breed == nil { - return nil, false + if o == nil || isNil(o.Breed) { + return nil, false } return o.Breed, true } // HasBreed returns a boolean if a field has been set. func (o *DogAllOf) HasBreed() bool { - if o != nil && o.Breed != nil { + if o != nil && !isNil(o.Breed) { return true } @@ -73,7 +73,7 @@ func (o *DogAllOf) SetBreed(v string) { func (o DogAllOf) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Breed != nil { + if !isNil(o.Breed) { toSerialize["breed"] = o.Breed } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_child.go b/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_child.go index cc199bfc049..4c0bec52ab9 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_child.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_child.go @@ -45,7 +45,7 @@ func NewDuplicatedPropChildWithDefaults() *DuplicatedPropChild { // GetDupProp returns the DupProp field value if set, zero value otherwise. func (o *DuplicatedPropChild) GetDupProp() string { - if o == nil || o.DupProp == nil { + if o == nil || isNil(o.DupProp) { var ret string return ret } @@ -55,15 +55,15 @@ func (o *DuplicatedPropChild) GetDupProp() string { // GetDupPropOk returns a tuple with the DupProp field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DuplicatedPropChild) GetDupPropOk() (*string, bool) { - if o == nil || o.DupProp == nil { - return nil, false + if o == nil || isNil(o.DupProp) { + return nil, false } return o.DupProp, true } // HasDupProp returns a boolean if a field has been set. func (o *DuplicatedPropChild) HasDupProp() bool { - if o != nil && o.DupProp != nil { + if o != nil && !isNil(o.DupProp) { return true } @@ -85,7 +85,7 @@ func (o DuplicatedPropChild) MarshalJSON() ([]byte, error) { if errDuplicatedPropParent != nil { return []byte{}, errDuplicatedPropParent } - if o.DupProp != nil { + if !isNil(o.DupProp) { toSerialize["dup-prop"] = o.DupProp } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_child_all_of.go b/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_child_all_of.go index ff6387b6814..9e456999a1c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_child_all_of.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_child_all_of.go @@ -42,7 +42,7 @@ func NewDuplicatedPropChildAllOfWithDefaults() *DuplicatedPropChildAllOf { // GetDupProp returns the DupProp field value if set, zero value otherwise. func (o *DuplicatedPropChildAllOf) GetDupProp() string { - if o == nil || o.DupProp == nil { + if o == nil || isNil(o.DupProp) { var ret string return ret } @@ -52,15 +52,15 @@ func (o *DuplicatedPropChildAllOf) GetDupProp() string { // GetDupPropOk returns a tuple with the DupProp field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DuplicatedPropChildAllOf) GetDupPropOk() (*string, bool) { - if o == nil || o.DupProp == nil { - return nil, false + if o == nil || isNil(o.DupProp) { + return nil, false } return o.DupProp, true } // HasDupProp returns a boolean if a field has been set. func (o *DuplicatedPropChildAllOf) HasDupProp() bool { - if o != nil && o.DupProp != nil { + if o != nil && !isNil(o.DupProp) { return true } @@ -74,7 +74,7 @@ func (o *DuplicatedPropChildAllOf) SetDupProp(v string) { func (o DuplicatedPropChildAllOf) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.DupProp != nil { + if !isNil(o.DupProp) { toSerialize["dup-prop"] = o.DupProp } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_parent.go b/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_parent.go index 59f7f32eb7a..fa95a4edf5f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_parent.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_parent.go @@ -55,7 +55,7 @@ func (o *DuplicatedPropParent) GetDupProp() string { // and a boolean to check if the value has been set. func (o *DuplicatedPropParent) GetDupPropOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.DupProp, true } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go index 9ed5be80d6c..622768e8ae3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go @@ -42,7 +42,7 @@ func NewEnumArraysWithDefaults() *EnumArrays { // GetJustSymbol returns the JustSymbol field value if set, zero value otherwise. func (o *EnumArrays) GetJustSymbol() string { - if o == nil || o.JustSymbol == nil { + if o == nil || isNil(o.JustSymbol) { var ret string return ret } @@ -52,15 +52,15 @@ func (o *EnumArrays) GetJustSymbol() string { // GetJustSymbolOk returns a tuple with the JustSymbol field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumArrays) GetJustSymbolOk() (*string, bool) { - if o == nil || o.JustSymbol == nil { - return nil, false + if o == nil || isNil(o.JustSymbol) { + return nil, false } return o.JustSymbol, true } // HasJustSymbol returns a boolean if a field has been set. func (o *EnumArrays) HasJustSymbol() bool { - if o != nil && o.JustSymbol != nil { + if o != nil && !isNil(o.JustSymbol) { return true } @@ -74,7 +74,7 @@ func (o *EnumArrays) SetJustSymbol(v string) { // GetArrayEnum returns the ArrayEnum field value if set, zero value otherwise. func (o *EnumArrays) GetArrayEnum() []string { - if o == nil || o.ArrayEnum == nil { + if o == nil || isNil(o.ArrayEnum) { var ret []string return ret } @@ -84,15 +84,15 @@ func (o *EnumArrays) GetArrayEnum() []string { // GetArrayEnumOk returns a tuple with the ArrayEnum field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumArrays) GetArrayEnumOk() ([]string, bool) { - if o == nil || o.ArrayEnum == nil { - return nil, false + if o == nil || isNil(o.ArrayEnum) { + return nil, false } return o.ArrayEnum, true } // HasArrayEnum returns a boolean if a field has been set. func (o *EnumArrays) HasArrayEnum() bool { - if o != nil && o.ArrayEnum != nil { + if o != nil && !isNil(o.ArrayEnum) { return true } @@ -106,10 +106,10 @@ func (o *EnumArrays) SetArrayEnum(v []string) { func (o EnumArrays) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.JustSymbol != nil { + if !isNil(o.JustSymbol) { toSerialize["just_symbol"] = o.JustSymbol } - if o.ArrayEnum != nil { + if !isNil(o.ArrayEnum) { toSerialize["array_enum"] = o.ArrayEnum } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go index 367a1c46d21..aec53b6795c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go @@ -57,7 +57,7 @@ func NewEnumTestWithDefaults() *EnumTest { // GetEnumString returns the EnumString field value if set, zero value otherwise. func (o *EnumTest) GetEnumString() string { - if o == nil || o.EnumString == nil { + if o == nil || isNil(o.EnumString) { var ret string return ret } @@ -67,15 +67,15 @@ func (o *EnumTest) GetEnumString() string { // GetEnumStringOk returns a tuple with the EnumString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumTest) GetEnumStringOk() (*string, bool) { - if o == nil || o.EnumString == nil { - return nil, false + if o == nil || isNil(o.EnumString) { + return nil, false } return o.EnumString, true } // HasEnumString returns a boolean if a field has been set. func (o *EnumTest) HasEnumString() bool { - if o != nil && o.EnumString != nil { + if o != nil && !isNil(o.EnumString) { return true } @@ -101,7 +101,7 @@ func (o *EnumTest) GetEnumStringRequired() string { // and a boolean to check if the value has been set. func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.EnumStringRequired, true } @@ -113,7 +113,7 @@ func (o *EnumTest) SetEnumStringRequired(v string) { // GetEnumInteger returns the EnumInteger field value if set, zero value otherwise. func (o *EnumTest) GetEnumInteger() int32 { - if o == nil || o.EnumInteger == nil { + if o == nil || isNil(o.EnumInteger) { var ret int32 return ret } @@ -123,15 +123,15 @@ func (o *EnumTest) GetEnumInteger() int32 { // GetEnumIntegerOk returns a tuple with the EnumInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumTest) GetEnumIntegerOk() (*int32, bool) { - if o == nil || o.EnumInteger == nil { - return nil, false + if o == nil || isNil(o.EnumInteger) { + return nil, false } return o.EnumInteger, true } // HasEnumInteger returns a boolean if a field has been set. func (o *EnumTest) HasEnumInteger() bool { - if o != nil && o.EnumInteger != nil { + if o != nil && !isNil(o.EnumInteger) { return true } @@ -145,7 +145,7 @@ func (o *EnumTest) SetEnumInteger(v int32) { // GetEnumNumber returns the EnumNumber field value if set, zero value otherwise. func (o *EnumTest) GetEnumNumber() float64 { - if o == nil || o.EnumNumber == nil { + if o == nil || isNil(o.EnumNumber) { var ret float64 return ret } @@ -155,15 +155,15 @@ func (o *EnumTest) GetEnumNumber() float64 { // GetEnumNumberOk returns a tuple with the EnumNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumTest) GetEnumNumberOk() (*float64, bool) { - if o == nil || o.EnumNumber == nil { - return nil, false + if o == nil || isNil(o.EnumNumber) { + return nil, false } return o.EnumNumber, true } // HasEnumNumber returns a boolean if a field has been set. func (o *EnumTest) HasEnumNumber() bool { - if o != nil && o.EnumNumber != nil { + if o != nil && !isNil(o.EnumNumber) { return true } @@ -177,7 +177,7 @@ func (o *EnumTest) SetEnumNumber(v float64) { // GetOuterEnum returns the OuterEnum field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EnumTest) GetOuterEnum() OuterEnum { - if o == nil || o.OuterEnum.Get() == nil { + if o == nil || isNil(o.OuterEnum.Get()) { var ret OuterEnum return ret } @@ -189,7 +189,7 @@ func (o *EnumTest) GetOuterEnum() OuterEnum { // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool) { if o == nil { - return nil, false + return nil, false } return o.OuterEnum.Get(), o.OuterEnum.IsSet() } @@ -219,7 +219,7 @@ func (o *EnumTest) UnsetOuterEnum() { // GetOuterEnumInteger returns the OuterEnumInteger field value if set, zero value otherwise. func (o *EnumTest) GetOuterEnumInteger() OuterEnumInteger { - if o == nil || o.OuterEnumInteger == nil { + if o == nil || isNil(o.OuterEnumInteger) { var ret OuterEnumInteger return ret } @@ -229,15 +229,15 @@ func (o *EnumTest) GetOuterEnumInteger() OuterEnumInteger { // GetOuterEnumIntegerOk returns a tuple with the OuterEnumInteger field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumTest) GetOuterEnumIntegerOk() (*OuterEnumInteger, bool) { - if o == nil || o.OuterEnumInteger == nil { - return nil, false + if o == nil || isNil(o.OuterEnumInteger) { + return nil, false } return o.OuterEnumInteger, true } // HasOuterEnumInteger returns a boolean if a field has been set. func (o *EnumTest) HasOuterEnumInteger() bool { - if o != nil && o.OuterEnumInteger != nil { + if o != nil && !isNil(o.OuterEnumInteger) { return true } @@ -251,7 +251,7 @@ func (o *EnumTest) SetOuterEnumInteger(v OuterEnumInteger) { // GetOuterEnumDefaultValue returns the OuterEnumDefaultValue field value if set, zero value otherwise. func (o *EnumTest) GetOuterEnumDefaultValue() OuterEnumDefaultValue { - if o == nil || o.OuterEnumDefaultValue == nil { + if o == nil || isNil(o.OuterEnumDefaultValue) { var ret OuterEnumDefaultValue return ret } @@ -261,15 +261,15 @@ func (o *EnumTest) GetOuterEnumDefaultValue() OuterEnumDefaultValue { // GetOuterEnumDefaultValueOk returns a tuple with the OuterEnumDefaultValue field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumTest) GetOuterEnumDefaultValueOk() (*OuterEnumDefaultValue, bool) { - if o == nil || o.OuterEnumDefaultValue == nil { - return nil, false + if o == nil || isNil(o.OuterEnumDefaultValue) { + return nil, false } return o.OuterEnumDefaultValue, true } // HasOuterEnumDefaultValue returns a boolean if a field has been set. func (o *EnumTest) HasOuterEnumDefaultValue() bool { - if o != nil && o.OuterEnumDefaultValue != nil { + if o != nil && !isNil(o.OuterEnumDefaultValue) { return true } @@ -283,7 +283,7 @@ func (o *EnumTest) SetOuterEnumDefaultValue(v OuterEnumDefaultValue) { // GetOuterEnumIntegerDefaultValue returns the OuterEnumIntegerDefaultValue field value if set, zero value otherwise. func (o *EnumTest) GetOuterEnumIntegerDefaultValue() OuterEnumIntegerDefaultValue { - if o == nil || o.OuterEnumIntegerDefaultValue == nil { + if o == nil || isNil(o.OuterEnumIntegerDefaultValue) { var ret OuterEnumIntegerDefaultValue return ret } @@ -293,15 +293,15 @@ func (o *EnumTest) GetOuterEnumIntegerDefaultValue() OuterEnumIntegerDefaultValu // GetOuterEnumIntegerDefaultValueOk returns a tuple with the OuterEnumIntegerDefaultValue field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EnumTest) GetOuterEnumIntegerDefaultValueOk() (*OuterEnumIntegerDefaultValue, bool) { - if o == nil || o.OuterEnumIntegerDefaultValue == nil { - return nil, false + if o == nil || isNil(o.OuterEnumIntegerDefaultValue) { + return nil, false } return o.OuterEnumIntegerDefaultValue, true } // HasOuterEnumIntegerDefaultValue returns a boolean if a field has been set. func (o *EnumTest) HasOuterEnumIntegerDefaultValue() bool { - if o != nil && o.OuterEnumIntegerDefaultValue != nil { + if o != nil && !isNil(o.OuterEnumIntegerDefaultValue) { return true } @@ -315,28 +315,28 @@ func (o *EnumTest) SetOuterEnumIntegerDefaultValue(v OuterEnumIntegerDefaultValu func (o EnumTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.EnumString != nil { + if !isNil(o.EnumString) { toSerialize["enum_string"] = o.EnumString } if true { toSerialize["enum_string_required"] = o.EnumStringRequired } - if o.EnumInteger != nil { + if !isNil(o.EnumInteger) { toSerialize["enum_integer"] = o.EnumInteger } - if o.EnumNumber != nil { + if !isNil(o.EnumNumber) { toSerialize["enum_number"] = o.EnumNumber } if o.OuterEnum.IsSet() { toSerialize["outerEnum"] = o.OuterEnum.Get() } - if o.OuterEnumInteger != nil { + if !isNil(o.OuterEnumInteger) { toSerialize["outerEnumInteger"] = o.OuterEnumInteger } - if o.OuterEnumDefaultValue != nil { + if !isNil(o.OuterEnumDefaultValue) { toSerialize["outerEnumDefaultValue"] = o.OuterEnumDefaultValue } - if o.OuterEnumIntegerDefaultValue != nil { + if !isNil(o.OuterEnumIntegerDefaultValue) { toSerialize["outerEnumIntegerDefaultValue"] = o.OuterEnumIntegerDefaultValue } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_file.go b/samples/openapi3/client/petstore/go/go-petstore/model_file.go index db093e41755..c850c827ffe 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_file.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_file.go @@ -42,7 +42,7 @@ func NewFileWithDefaults() *File { // GetSourceURI returns the SourceURI field value if set, zero value otherwise. func (o *File) GetSourceURI() string { - if o == nil || o.SourceURI == nil { + if o == nil || isNil(o.SourceURI) { var ret string return ret } @@ -52,15 +52,15 @@ func (o *File) GetSourceURI() string { // GetSourceURIOk returns a tuple with the SourceURI field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *File) GetSourceURIOk() (*string, bool) { - if o == nil || o.SourceURI == nil { - return nil, false + if o == nil || isNil(o.SourceURI) { + return nil, false } return o.SourceURI, true } // HasSourceURI returns a boolean if a field has been set. func (o *File) HasSourceURI() bool { - if o != nil && o.SourceURI != nil { + if o != nil && !isNil(o.SourceURI) { return true } @@ -74,7 +74,7 @@ func (o *File) SetSourceURI(v string) { func (o File) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.SourceURI != nil { + if !isNil(o.SourceURI) { toSerialize["sourceURI"] = o.SourceURI } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go index a61e7d43a7b..c6627b01a14 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go @@ -42,7 +42,7 @@ func NewFileSchemaTestClassWithDefaults() *FileSchemaTestClass { // GetFile returns the File field value if set, zero value otherwise. func (o *FileSchemaTestClass) GetFile() File { - if o == nil || o.File == nil { + if o == nil || isNil(o.File) { var ret File return ret } @@ -52,15 +52,15 @@ func (o *FileSchemaTestClass) GetFile() File { // GetFileOk returns a tuple with the File field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FileSchemaTestClass) GetFileOk() (*File, bool) { - if o == nil || o.File == nil { - return nil, false + if o == nil || isNil(o.File) { + return nil, false } return o.File, true } // HasFile returns a boolean if a field has been set. func (o *FileSchemaTestClass) HasFile() bool { - if o != nil && o.File != nil { + if o != nil && !isNil(o.File) { return true } @@ -74,7 +74,7 @@ func (o *FileSchemaTestClass) SetFile(v File) { // GetFiles returns the Files field value if set, zero value otherwise. func (o *FileSchemaTestClass) GetFiles() []File { - if o == nil || o.Files == nil { + if o == nil || isNil(o.Files) { var ret []File return ret } @@ -84,15 +84,15 @@ func (o *FileSchemaTestClass) GetFiles() []File { // GetFilesOk returns a tuple with the Files field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FileSchemaTestClass) GetFilesOk() ([]File, bool) { - if o == nil || o.Files == nil { - return nil, false + if o == nil || isNil(o.Files) { + return nil, false } return o.Files, true } // HasFiles returns a boolean if a field has been set. func (o *FileSchemaTestClass) HasFiles() bool { - if o != nil && o.Files != nil { + if o != nil && !isNil(o.Files) { return true } @@ -106,10 +106,10 @@ func (o *FileSchemaTestClass) SetFiles(v []File) { func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.File != nil { + if !isNil(o.File) { toSerialize["file"] = o.File } - if o.Files != nil { + if !isNil(o.Files) { toSerialize["files"] = o.Files } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_foo.go b/samples/openapi3/client/petstore/go/go-petstore/model_foo.go index c4a466b4ac2..145def4ff16 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_foo.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_foo.go @@ -45,7 +45,7 @@ func NewFooWithDefaults() *Foo { // GetBar returns the Bar field value if set, zero value otherwise. func (o *Foo) GetBar() string { - if o == nil || o.Bar == nil { + if o == nil || isNil(o.Bar) { var ret string return ret } @@ -55,15 +55,15 @@ func (o *Foo) GetBar() string { // GetBarOk returns a tuple with the Bar field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Foo) GetBarOk() (*string, bool) { - if o == nil || o.Bar == nil { - return nil, false + if o == nil || isNil(o.Bar) { + return nil, false } return o.Bar, true } // HasBar returns a boolean if a field has been set. func (o *Foo) HasBar() bool { - if o != nil && o.Bar != nil { + if o != nil && !isNil(o.Bar) { return true } @@ -77,7 +77,7 @@ func (o *Foo) SetBar(v string) { func (o Foo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Bar != nil { + if !isNil(o.Bar) { toSerialize["bar"] = o.Bar } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go index 64c5bf0aed1..bc69d8dabb7 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go @@ -63,7 +63,7 @@ func NewFormatTestWithDefaults() *FormatTest { // GetInteger returns the Integer field value if set, zero value otherwise. func (o *FormatTest) GetInteger() int32 { - if o == nil || o.Integer == nil { + if o == nil || isNil(o.Integer) { var ret int32 return ret } @@ -73,15 +73,15 @@ func (o *FormatTest) GetInteger() int32 { // GetIntegerOk returns a tuple with the Integer field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetIntegerOk() (*int32, bool) { - if o == nil || o.Integer == nil { - return nil, false + if o == nil || isNil(o.Integer) { + return nil, false } return o.Integer, true } // HasInteger returns a boolean if a field has been set. func (o *FormatTest) HasInteger() bool { - if o != nil && o.Integer != nil { + if o != nil && !isNil(o.Integer) { return true } @@ -95,7 +95,7 @@ func (o *FormatTest) SetInteger(v int32) { // GetInt32 returns the Int32 field value if set, zero value otherwise. func (o *FormatTest) GetInt32() int32 { - if o == nil || o.Int32 == nil { + if o == nil || isNil(o.Int32) { var ret int32 return ret } @@ -105,15 +105,15 @@ func (o *FormatTest) GetInt32() int32 { // GetInt32Ok returns a tuple with the Int32 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetInt32Ok() (*int32, bool) { - if o == nil || o.Int32 == nil { - return nil, false + if o == nil || isNil(o.Int32) { + return nil, false } return o.Int32, true } // HasInt32 returns a boolean if a field has been set. func (o *FormatTest) HasInt32() bool { - if o != nil && o.Int32 != nil { + if o != nil && !isNil(o.Int32) { return true } @@ -127,7 +127,7 @@ func (o *FormatTest) SetInt32(v int32) { // GetInt64 returns the Int64 field value if set, zero value otherwise. func (o *FormatTest) GetInt64() int64 { - if o == nil || o.Int64 == nil { + if o == nil || isNil(o.Int64) { var ret int64 return ret } @@ -137,15 +137,15 @@ func (o *FormatTest) GetInt64() int64 { // GetInt64Ok returns a tuple with the Int64 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetInt64Ok() (*int64, bool) { - if o == nil || o.Int64 == nil { - return nil, false + if o == nil || isNil(o.Int64) { + return nil, false } return o.Int64, true } // HasInt64 returns a boolean if a field has been set. func (o *FormatTest) HasInt64() bool { - if o != nil && o.Int64 != nil { + if o != nil && !isNil(o.Int64) { return true } @@ -171,7 +171,7 @@ func (o *FormatTest) GetNumber() float32 { // and a boolean to check if the value has been set. func (o *FormatTest) GetNumberOk() (*float32, bool) { if o == nil { - return nil, false + return nil, false } return &o.Number, true } @@ -183,7 +183,7 @@ func (o *FormatTest) SetNumber(v float32) { // GetFloat returns the Float field value if set, zero value otherwise. func (o *FormatTest) GetFloat() float32 { - if o == nil || o.Float == nil { + if o == nil || isNil(o.Float) { var ret float32 return ret } @@ -193,15 +193,15 @@ func (o *FormatTest) GetFloat() float32 { // GetFloatOk returns a tuple with the Float field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetFloatOk() (*float32, bool) { - if o == nil || o.Float == nil { - return nil, false + if o == nil || isNil(o.Float) { + return nil, false } return o.Float, true } // HasFloat returns a boolean if a field has been set. func (o *FormatTest) HasFloat() bool { - if o != nil && o.Float != nil { + if o != nil && !isNil(o.Float) { return true } @@ -215,7 +215,7 @@ func (o *FormatTest) SetFloat(v float32) { // GetDouble returns the Double field value if set, zero value otherwise. func (o *FormatTest) GetDouble() float64 { - if o == nil || o.Double == nil { + if o == nil || isNil(o.Double) { var ret float64 return ret } @@ -225,15 +225,15 @@ func (o *FormatTest) GetDouble() float64 { // GetDoubleOk returns a tuple with the Double field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetDoubleOk() (*float64, bool) { - if o == nil || o.Double == nil { - return nil, false + if o == nil || isNil(o.Double) { + return nil, false } return o.Double, true } // HasDouble returns a boolean if a field has been set. func (o *FormatTest) HasDouble() bool { - if o != nil && o.Double != nil { + if o != nil && !isNil(o.Double) { return true } @@ -247,7 +247,7 @@ func (o *FormatTest) SetDouble(v float64) { // GetString returns the String field value if set, zero value otherwise. func (o *FormatTest) GetString() string { - if o == nil || o.String == nil { + if o == nil || isNil(o.String) { var ret string return ret } @@ -257,15 +257,15 @@ func (o *FormatTest) GetString() string { // GetStringOk returns a tuple with the String field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetStringOk() (*string, bool) { - if o == nil || o.String == nil { - return nil, false + if o == nil || isNil(o.String) { + return nil, false } return o.String, true } // HasString returns a boolean if a field has been set. func (o *FormatTest) HasString() bool { - if o != nil && o.String != nil { + if o != nil && !isNil(o.String) { return true } @@ -291,7 +291,7 @@ func (o *FormatTest) GetByte() string { // and a boolean to check if the value has been set. func (o *FormatTest) GetByteOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Byte, true } @@ -303,7 +303,7 @@ func (o *FormatTest) SetByte(v string) { // GetBinary returns the Binary field value if set, zero value otherwise. func (o *FormatTest) GetBinary() *os.File { - if o == nil || o.Binary == nil { + if o == nil || isNil(o.Binary) { var ret *os.File return ret } @@ -313,15 +313,15 @@ func (o *FormatTest) GetBinary() *os.File { // GetBinaryOk returns a tuple with the Binary field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetBinaryOk() (**os.File, bool) { - if o == nil || o.Binary == nil { - return nil, false + if o == nil || isNil(o.Binary) { + return nil, false } return o.Binary, true } // HasBinary returns a boolean if a field has been set. func (o *FormatTest) HasBinary() bool { - if o != nil && o.Binary != nil { + if o != nil && !isNil(o.Binary) { return true } @@ -347,7 +347,7 @@ func (o *FormatTest) GetDate() string { // and a boolean to check if the value has been set. func (o *FormatTest) GetDateOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Date, true } @@ -359,7 +359,7 @@ func (o *FormatTest) SetDate(v string) { // GetDateTime returns the DateTime field value if set, zero value otherwise. func (o *FormatTest) GetDateTime() time.Time { - if o == nil || o.DateTime == nil { + if o == nil || isNil(o.DateTime) { var ret time.Time return ret } @@ -369,15 +369,15 @@ func (o *FormatTest) GetDateTime() time.Time { // GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetDateTimeOk() (*time.Time, bool) { - if o == nil || o.DateTime == nil { - return nil, false + if o == nil || isNil(o.DateTime) { + return nil, false } return o.DateTime, true } // HasDateTime returns a boolean if a field has been set. func (o *FormatTest) HasDateTime() bool { - if o != nil && o.DateTime != nil { + if o != nil && !isNil(o.DateTime) { return true } @@ -391,7 +391,7 @@ func (o *FormatTest) SetDateTime(v time.Time) { // GetUuid returns the Uuid field value if set, zero value otherwise. func (o *FormatTest) GetUuid() string { - if o == nil || o.Uuid == nil { + if o == nil || isNil(o.Uuid) { var ret string return ret } @@ -401,15 +401,15 @@ func (o *FormatTest) GetUuid() string { // GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetUuidOk() (*string, bool) { - if o == nil || o.Uuid == nil { - return nil, false + if o == nil || isNil(o.Uuid) { + return nil, false } return o.Uuid, true } // HasUuid returns a boolean if a field has been set. func (o *FormatTest) HasUuid() bool { - if o != nil && o.Uuid != nil { + if o != nil && !isNil(o.Uuid) { return true } @@ -435,7 +435,7 @@ func (o *FormatTest) GetPassword() string { // and a boolean to check if the value has been set. func (o *FormatTest) GetPasswordOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Password, true } @@ -447,7 +447,7 @@ func (o *FormatTest) SetPassword(v string) { // GetPatternWithDigits returns the PatternWithDigits field value if set, zero value otherwise. func (o *FormatTest) GetPatternWithDigits() string { - if o == nil || o.PatternWithDigits == nil { + if o == nil || isNil(o.PatternWithDigits) { var ret string return ret } @@ -457,15 +457,15 @@ func (o *FormatTest) GetPatternWithDigits() string { // GetPatternWithDigitsOk returns a tuple with the PatternWithDigits field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetPatternWithDigitsOk() (*string, bool) { - if o == nil || o.PatternWithDigits == nil { - return nil, false + if o == nil || isNil(o.PatternWithDigits) { + return nil, false } return o.PatternWithDigits, true } // HasPatternWithDigits returns a boolean if a field has been set. func (o *FormatTest) HasPatternWithDigits() bool { - if o != nil && o.PatternWithDigits != nil { + if o != nil && !isNil(o.PatternWithDigits) { return true } @@ -479,7 +479,7 @@ func (o *FormatTest) SetPatternWithDigits(v string) { // GetPatternWithDigitsAndDelimiter returns the PatternWithDigitsAndDelimiter field value if set, zero value otherwise. func (o *FormatTest) GetPatternWithDigitsAndDelimiter() string { - if o == nil || o.PatternWithDigitsAndDelimiter == nil { + if o == nil || isNil(o.PatternWithDigitsAndDelimiter) { var ret string return ret } @@ -489,15 +489,15 @@ func (o *FormatTest) GetPatternWithDigitsAndDelimiter() string { // GetPatternWithDigitsAndDelimiterOk returns a tuple with the PatternWithDigitsAndDelimiter field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *FormatTest) GetPatternWithDigitsAndDelimiterOk() (*string, bool) { - if o == nil || o.PatternWithDigitsAndDelimiter == nil { - return nil, false + if o == nil || isNil(o.PatternWithDigitsAndDelimiter) { + return nil, false } return o.PatternWithDigitsAndDelimiter, true } // HasPatternWithDigitsAndDelimiter returns a boolean if a field has been set. func (o *FormatTest) HasPatternWithDigitsAndDelimiter() bool { - if o != nil && o.PatternWithDigitsAndDelimiter != nil { + if o != nil && !isNil(o.PatternWithDigitsAndDelimiter) { return true } @@ -511,49 +511,49 @@ func (o *FormatTest) SetPatternWithDigitsAndDelimiter(v string) { func (o FormatTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Integer != nil { + if !isNil(o.Integer) { toSerialize["integer"] = o.Integer } - if o.Int32 != nil { + if !isNil(o.Int32) { toSerialize["int32"] = o.Int32 } - if o.Int64 != nil { + if !isNil(o.Int64) { toSerialize["int64"] = o.Int64 } if true { toSerialize["number"] = o.Number } - if o.Float != nil { + if !isNil(o.Float) { toSerialize["float"] = o.Float } - if o.Double != nil { + if !isNil(o.Double) { toSerialize["double"] = o.Double } - if o.String != nil { + if !isNil(o.String) { toSerialize["string"] = o.String } if true { toSerialize["byte"] = o.Byte } - if o.Binary != nil { + if !isNil(o.Binary) { toSerialize["binary"] = o.Binary } if true { toSerialize["date"] = o.Date } - if o.DateTime != nil { + if !isNil(o.DateTime) { toSerialize["dateTime"] = o.DateTime } - if o.Uuid != nil { + if !isNil(o.Uuid) { toSerialize["uuid"] = o.Uuid } if true { toSerialize["password"] = o.Password } - if o.PatternWithDigits != nil { + if !isNil(o.PatternWithDigits) { toSerialize["pattern_with_digits"] = o.PatternWithDigits } - if o.PatternWithDigitsAndDelimiter != nil { + if !isNil(o.PatternWithDigitsAndDelimiter) { toSerialize["pattern_with_digits_and_delimiter"] = o.PatternWithDigitsAndDelimiter } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go index 74b0aa52b3c..de6c7867502 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go @@ -71,11 +71,11 @@ func (dst *Fruit) UnmarshalJSON(data []byte) error { dst.Apple = nil dst.Banana = nil - return fmt.Errorf("Data matches more than one schema in oneOf(Fruit)") + return fmt.Errorf("data matches more than one schema in oneOf(Fruit)") } else if match == 1 { return nil // exactly one match } else { // no match - return fmt.Errorf("Data failed to match schemas in oneOf(Fruit)") + return fmt.Errorf("data failed to match schemas in oneOf(Fruit)") } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go index 82ff8714324..7dccf1d8128 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go @@ -71,11 +71,11 @@ func (dst *FruitReq) UnmarshalJSON(data []byte) error { dst.AppleReq = nil dst.BananaReq = nil - return fmt.Errorf("Data matches more than one schema in oneOf(FruitReq)") + return fmt.Errorf("data matches more than one schema in oneOf(FruitReq)") } else if match == 1 { return nil // exactly one match } else { // no match - return fmt.Errorf("Data failed to match schemas in oneOf(FruitReq)") + return fmt.Errorf("data failed to match schemas in oneOf(FruitReq)") } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_gm_fruit.go b/samples/openapi3/client/petstore/go/go-petstore/model_gm_fruit.go index bc1023eacaf..fbed807427e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_gm_fruit.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_gm_fruit.go @@ -50,7 +50,7 @@ func (dst *GmFruit) UnmarshalJSON(data []byte) error { dst.Banana = nil } - return fmt.Errorf("Data failed to match schemas in anyOf(GmFruit)") + return fmt.Errorf("data failed to match schemas in anyOf(GmFruit)") } // Marshal data from the first non-nil pointers in the struct to JSON diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go index 08dad1f62cc..64ffc72e40d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go @@ -42,7 +42,7 @@ func NewHasOnlyReadOnlyWithDefaults() *HasOnlyReadOnly { // GetBar returns the Bar field value if set, zero value otherwise. func (o *HasOnlyReadOnly) GetBar() string { - if o == nil || o.Bar == nil { + if o == nil || isNil(o.Bar) { var ret string return ret } @@ -52,15 +52,15 @@ func (o *HasOnlyReadOnly) GetBar() string { // GetBarOk returns a tuple with the Bar field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HasOnlyReadOnly) GetBarOk() (*string, bool) { - if o == nil || o.Bar == nil { - return nil, false + if o == nil || isNil(o.Bar) { + return nil, false } return o.Bar, true } // HasBar returns a boolean if a field has been set. func (o *HasOnlyReadOnly) HasBar() bool { - if o != nil && o.Bar != nil { + if o != nil && !isNil(o.Bar) { return true } @@ -74,7 +74,7 @@ func (o *HasOnlyReadOnly) SetBar(v string) { // GetFoo returns the Foo field value if set, zero value otherwise. func (o *HasOnlyReadOnly) GetFoo() string { - if o == nil || o.Foo == nil { + if o == nil || isNil(o.Foo) { var ret string return ret } @@ -84,15 +84,15 @@ func (o *HasOnlyReadOnly) GetFoo() string { // GetFooOk returns a tuple with the Foo field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HasOnlyReadOnly) GetFooOk() (*string, bool) { - if o == nil || o.Foo == nil { - return nil, false + if o == nil || isNil(o.Foo) { + return nil, false } return o.Foo, true } // HasFoo returns a boolean if a field has been set. func (o *HasOnlyReadOnly) HasFoo() bool { - if o != nil && o.Foo != nil { + if o != nil && !isNil(o.Foo) { return true } @@ -106,10 +106,10 @@ func (o *HasOnlyReadOnly) SetFoo(v string) { func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Bar != nil { + if !isNil(o.Bar) { toSerialize["bar"] = o.Bar } - if o.Foo != nil { + if !isNil(o.Foo) { toSerialize["foo"] = o.Foo } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go b/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go index 769a5d44868..dd7aa8d8b16 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go @@ -41,7 +41,7 @@ func NewHealthCheckResultWithDefaults() *HealthCheckResult { // GetNullableMessage returns the NullableMessage field value if set, zero value otherwise (both if not set or set to explicit null). func (o *HealthCheckResult) GetNullableMessage() string { - if o == nil || o.NullableMessage.Get() == nil { + if o == nil || isNil(o.NullableMessage.Get()) { var ret string return ret } @@ -53,7 +53,7 @@ func (o *HealthCheckResult) GetNullableMessage() string { // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *HealthCheckResult) GetNullableMessageOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return o.NullableMessage.Get(), o.NullableMessage.IsSet() } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_list.go b/samples/openapi3/client/petstore/go/go-petstore/model_list.go index 07e4bdd27a6..ee1faa38b75 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_list.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_list.go @@ -41,7 +41,7 @@ func NewListWithDefaults() *List { // GetVar123List returns the Var123List field value if set, zero value otherwise. func (o *List) GetVar123List() string { - if o == nil || o.Var123List == nil { + if o == nil || isNil(o.Var123List) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *List) GetVar123List() string { // GetVar123ListOk returns a tuple with the Var123List field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *List) GetVar123ListOk() (*string, bool) { - if o == nil || o.Var123List == nil { - return nil, false + if o == nil || isNil(o.Var123List) { + return nil, false } return o.Var123List, true } // HasVar123List returns a boolean if a field has been set. func (o *List) HasVar123List() bool { - if o != nil && o.Var123List != nil { + if o != nil && !isNil(o.Var123List) { return true } @@ -73,7 +73,7 @@ func (o *List) SetVar123List(v string) { func (o List) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Var123List != nil { + if !isNil(o.Var123List) { toSerialize["123-list"] = o.Var123List } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go b/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go index 7f899aa6db7..77a58b5d33b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go @@ -71,11 +71,11 @@ func (dst *Mammal) UnmarshalJSON(data []byte) error { dst.Whale = nil dst.Zebra = nil - return fmt.Errorf("Data matches more than one schema in oneOf(Mammal)") + return fmt.Errorf("data matches more than one schema in oneOf(Mammal)") } else if match == 1 { return nil // exactly one match } else { // no match - return fmt.Errorf("Data failed to match schemas in oneOf(Mammal)") + return fmt.Errorf("data failed to match schemas in oneOf(Mammal)") } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_map_of_file_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_map_of_file_test_.go index 89690bd72c4..f64dfb0488a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_map_of_file_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_map_of_file_test_.go @@ -43,7 +43,7 @@ func NewMapOfFileTestWithDefaults() *MapOfFileTest { // GetPropTest returns the PropTest field value if set, zero value otherwise. func (o *MapOfFileTest) GetPropTest() map[string]*os.File { - if o == nil || o.PropTest == nil { + if o == nil || isNil(o.PropTest) { var ret map[string]*os.File return ret } @@ -53,15 +53,15 @@ func (o *MapOfFileTest) GetPropTest() map[string]*os.File { // GetPropTestOk returns a tuple with the PropTest field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MapOfFileTest) GetPropTestOk() (*map[string]*os.File, bool) { - if o == nil || o.PropTest == nil { - return nil, false + if o == nil || isNil(o.PropTest) { + return nil, false } return o.PropTest, true } // HasPropTest returns a boolean if a field has been set. func (o *MapOfFileTest) HasPropTest() bool { - if o != nil && o.PropTest != nil { + if o != nil && !isNil(o.PropTest) { return true } @@ -75,7 +75,7 @@ func (o *MapOfFileTest) SetPropTest(v map[string]*os.File) { func (o MapOfFileTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.PropTest != nil { + if !isNil(o.PropTest) { toSerialize["prop_test"] = o.PropTest } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go index 36f315091b8..86e9ad60551 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go @@ -44,7 +44,7 @@ func NewMapTestWithDefaults() *MapTest { // GetMapMapOfString returns the MapMapOfString field value if set, zero value otherwise. func (o *MapTest) GetMapMapOfString() map[string]map[string]string { - if o == nil || o.MapMapOfString == nil { + if o == nil || isNil(o.MapMapOfString) { var ret map[string]map[string]string return ret } @@ -54,15 +54,15 @@ func (o *MapTest) GetMapMapOfString() map[string]map[string]string { // GetMapMapOfStringOk returns a tuple with the MapMapOfString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MapTest) GetMapMapOfStringOk() (*map[string]map[string]string, bool) { - if o == nil || o.MapMapOfString == nil { - return nil, false + if o == nil || isNil(o.MapMapOfString) { + return nil, false } return o.MapMapOfString, true } // HasMapMapOfString returns a boolean if a field has been set. func (o *MapTest) HasMapMapOfString() bool { - if o != nil && o.MapMapOfString != nil { + if o != nil && !isNil(o.MapMapOfString) { return true } @@ -76,7 +76,7 @@ func (o *MapTest) SetMapMapOfString(v map[string]map[string]string) { // GetMapOfEnumString returns the MapOfEnumString field value if set, zero value otherwise. func (o *MapTest) GetMapOfEnumString() map[string]string { - if o == nil || o.MapOfEnumString == nil { + if o == nil || isNil(o.MapOfEnumString) { var ret map[string]string return ret } @@ -86,15 +86,15 @@ func (o *MapTest) GetMapOfEnumString() map[string]string { // GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MapTest) GetMapOfEnumStringOk() (*map[string]string, bool) { - if o == nil || o.MapOfEnumString == nil { - return nil, false + if o == nil || isNil(o.MapOfEnumString) { + return nil, false } return o.MapOfEnumString, true } // HasMapOfEnumString returns a boolean if a field has been set. func (o *MapTest) HasMapOfEnumString() bool { - if o != nil && o.MapOfEnumString != nil { + if o != nil && !isNil(o.MapOfEnumString) { return true } @@ -108,7 +108,7 @@ func (o *MapTest) SetMapOfEnumString(v map[string]string) { // GetDirectMap returns the DirectMap field value if set, zero value otherwise. func (o *MapTest) GetDirectMap() map[string]bool { - if o == nil || o.DirectMap == nil { + if o == nil || isNil(o.DirectMap) { var ret map[string]bool return ret } @@ -118,15 +118,15 @@ func (o *MapTest) GetDirectMap() map[string]bool { // GetDirectMapOk returns a tuple with the DirectMap field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MapTest) GetDirectMapOk() (*map[string]bool, bool) { - if o == nil || o.DirectMap == nil { - return nil, false + if o == nil || isNil(o.DirectMap) { + return nil, false } return o.DirectMap, true } // HasDirectMap returns a boolean if a field has been set. func (o *MapTest) HasDirectMap() bool { - if o != nil && o.DirectMap != nil { + if o != nil && !isNil(o.DirectMap) { return true } @@ -140,7 +140,7 @@ func (o *MapTest) SetDirectMap(v map[string]bool) { // GetIndirectMap returns the IndirectMap field value if set, zero value otherwise. func (o *MapTest) GetIndirectMap() map[string]bool { - if o == nil || o.IndirectMap == nil { + if o == nil || isNil(o.IndirectMap) { var ret map[string]bool return ret } @@ -150,15 +150,15 @@ func (o *MapTest) GetIndirectMap() map[string]bool { // GetIndirectMapOk returns a tuple with the IndirectMap field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MapTest) GetIndirectMapOk() (*map[string]bool, bool) { - if o == nil || o.IndirectMap == nil { - return nil, false + if o == nil || isNil(o.IndirectMap) { + return nil, false } return o.IndirectMap, true } // HasIndirectMap returns a boolean if a field has been set. func (o *MapTest) HasIndirectMap() bool { - if o != nil && o.IndirectMap != nil { + if o != nil && !isNil(o.IndirectMap) { return true } @@ -172,16 +172,16 @@ func (o *MapTest) SetIndirectMap(v map[string]bool) { func (o MapTest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MapMapOfString != nil { + if !isNil(o.MapMapOfString) { toSerialize["map_map_of_string"] = o.MapMapOfString } - if o.MapOfEnumString != nil { + if !isNil(o.MapOfEnumString) { toSerialize["map_of_enum_string"] = o.MapOfEnumString } - if o.DirectMap != nil { + if !isNil(o.DirectMap) { toSerialize["direct_map"] = o.DirectMap } - if o.IndirectMap != nil { + if !isNil(o.IndirectMap) { toSerialize["indirect_map"] = o.IndirectMap } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go index a3a55d01443..290ad5082ed 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -44,7 +44,7 @@ func NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults() *MixedProperti // GetUuid returns the Uuid field value if set, zero value otherwise. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string { - if o == nil || o.Uuid == nil { + if o == nil || isNil(o.Uuid) { var ret string return ret } @@ -54,15 +54,15 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string { // GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (*string, bool) { - if o == nil || o.Uuid == nil { - return nil, false + if o == nil || isNil(o.Uuid) { + return nil, false } return o.Uuid, true } // HasUuid returns a boolean if a field has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool { - if o != nil && o.Uuid != nil { + if o != nil && !isNil(o.Uuid) { return true } @@ -76,7 +76,7 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string) { // GetDateTime returns the DateTime field value if set, zero value otherwise. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time { - if o == nil || o.DateTime == nil { + if o == nil || isNil(o.DateTime) { var ret time.Time return ret } @@ -86,15 +86,15 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time { // GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (*time.Time, bool) { - if o == nil || o.DateTime == nil { - return nil, false + if o == nil || isNil(o.DateTime) { + return nil, false } return o.DateTime, true } // HasDateTime returns a boolean if a field has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool { - if o != nil && o.DateTime != nil { + if o != nil && !isNil(o.DateTime) { return true } @@ -108,7 +108,7 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time) { // GetMap returns the Map field value if set, zero value otherwise. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal { - if o == nil || o.Map == nil { + if o == nil || isNil(o.Map) { var ret map[string]Animal return ret } @@ -118,15 +118,15 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal // GetMapOk returns a tuple with the Map field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (*map[string]Animal, bool) { - if o == nil || o.Map == nil { - return nil, false + if o == nil || isNil(o.Map) { + return nil, false } return o.Map, true } // HasMap returns a boolean if a field has been set. func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool { - if o != nil && o.Map != nil { + if o != nil && !isNil(o.Map) { return true } @@ -140,13 +140,13 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Uuid != nil { + if !isNil(o.Uuid) { toSerialize["uuid"] = o.Uuid } - if o.DateTime != nil { + if !isNil(o.DateTime) { toSerialize["dateTime"] = o.DateTime } - if o.Map != nil { + if !isNil(o.Map) { toSerialize["map"] = o.Map } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_name.go b/samples/openapi3/client/petstore/go/go-petstore/model_name.go index 51adb2a1611..e94a43b0c0f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_name.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_name.go @@ -57,7 +57,7 @@ func (o *Name) GetName() int32 { // and a boolean to check if the value has been set. func (o *Name) GetNameOk() (*int32, bool) { if o == nil { - return nil, false + return nil, false } return &o.Name, true } @@ -69,7 +69,7 @@ func (o *Name) SetName(v int32) { // GetSnakeCase returns the SnakeCase field value if set, zero value otherwise. func (o *Name) GetSnakeCase() int32 { - if o == nil || o.SnakeCase == nil { + if o == nil || isNil(o.SnakeCase) { var ret int32 return ret } @@ -79,15 +79,15 @@ func (o *Name) GetSnakeCase() int32 { // GetSnakeCaseOk returns a tuple with the SnakeCase field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Name) GetSnakeCaseOk() (*int32, bool) { - if o == nil || o.SnakeCase == nil { - return nil, false + if o == nil || isNil(o.SnakeCase) { + return nil, false } return o.SnakeCase, true } // HasSnakeCase returns a boolean if a field has been set. func (o *Name) HasSnakeCase() bool { - if o != nil && o.SnakeCase != nil { + if o != nil && !isNil(o.SnakeCase) { return true } @@ -101,7 +101,7 @@ func (o *Name) SetSnakeCase(v int32) { // GetProperty returns the Property field value if set, zero value otherwise. func (o *Name) GetProperty() string { - if o == nil || o.Property == nil { + if o == nil || isNil(o.Property) { var ret string return ret } @@ -111,15 +111,15 @@ func (o *Name) GetProperty() string { // GetPropertyOk returns a tuple with the Property field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Name) GetPropertyOk() (*string, bool) { - if o == nil || o.Property == nil { - return nil, false + if o == nil || isNil(o.Property) { + return nil, false } return o.Property, true } // HasProperty returns a boolean if a field has been set. func (o *Name) HasProperty() bool { - if o != nil && o.Property != nil { + if o != nil && !isNil(o.Property) { return true } @@ -133,7 +133,7 @@ func (o *Name) SetProperty(v string) { // GetVar123Number returns the Var123Number field value if set, zero value otherwise. func (o *Name) GetVar123Number() int32 { - if o == nil || o.Var123Number == nil { + if o == nil || isNil(o.Var123Number) { var ret int32 return ret } @@ -143,15 +143,15 @@ func (o *Name) GetVar123Number() int32 { // GetVar123NumberOk returns a tuple with the Var123Number field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Name) GetVar123NumberOk() (*int32, bool) { - if o == nil || o.Var123Number == nil { - return nil, false + if o == nil || isNil(o.Var123Number) { + return nil, false } return o.Var123Number, true } // HasVar123Number returns a boolean if a field has been set. func (o *Name) HasVar123Number() bool { - if o != nil && o.Var123Number != nil { + if o != nil && !isNil(o.Var123Number) { return true } @@ -168,13 +168,13 @@ func (o Name) MarshalJSON() ([]byte, error) { if true { toSerialize["name"] = o.Name } - if o.SnakeCase != nil { + if !isNil(o.SnakeCase) { toSerialize["snake_case"] = o.SnakeCase } - if o.Property != nil { + if !isNil(o.Property) { toSerialize["property"] = o.Property } - if o.Var123Number != nil { + if !isNil(o.Var123Number) { toSerialize["123Number"] = o.Var123Number } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_all_of.go b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_all_of.go index 2bd8971b2ae..4e2ca7760b6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_all_of.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_all_of.go @@ -41,7 +41,7 @@ func NewNullableAllOfWithDefaults() *NullableAllOf { // GetChild returns the Child field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableAllOf) GetChild() NullableAllOfChild { - if o == nil || o.Child.Get() == nil { + if o == nil || isNil(o.Child.Get()) { var ret NullableAllOfChild return ret } @@ -53,7 +53,7 @@ func (o *NullableAllOf) GetChild() NullableAllOfChild { // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableAllOf) GetChildOk() (*NullableAllOfChild, bool) { if o == nil { - return nil, false + return nil, false } return o.Child.Get(), o.Child.IsSet() } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_all_of_child.go b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_all_of_child.go index 7f9c7779d86..e445ed4d57f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_all_of_child.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_all_of_child.go @@ -41,7 +41,7 @@ func NewNullableAllOfChildWithDefaults() *NullableAllOfChild { // GetName returns the Name field value if set, zero value otherwise. func (o *NullableAllOfChild) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *NullableAllOfChild) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *NullableAllOfChild) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *NullableAllOfChild) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -73,7 +73,7 @@ func (o *NullableAllOfChild) SetName(v string) { func (o NullableAllOfChild) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go index f49994d4431..49d57949b0a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go @@ -54,7 +54,7 @@ func NewNullableClassWithDefaults() *NullableClass { // GetIntegerProp returns the IntegerProp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableClass) GetIntegerProp() int32 { - if o == nil || o.IntegerProp.Get() == nil { + if o == nil || isNil(o.IntegerProp.Get()) { var ret int32 return ret } @@ -66,7 +66,7 @@ func (o *NullableClass) GetIntegerProp() int32 { // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetIntegerPropOk() (*int32, bool) { if o == nil { - return nil, false + return nil, false } return o.IntegerProp.Get(), o.IntegerProp.IsSet() } @@ -96,7 +96,7 @@ func (o *NullableClass) UnsetIntegerProp() { // GetNumberProp returns the NumberProp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableClass) GetNumberProp() float32 { - if o == nil || o.NumberProp.Get() == nil { + if o == nil || isNil(o.NumberProp.Get()) { var ret float32 return ret } @@ -108,7 +108,7 @@ func (o *NullableClass) GetNumberProp() float32 { // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetNumberPropOk() (*float32, bool) { if o == nil { - return nil, false + return nil, false } return o.NumberProp.Get(), o.NumberProp.IsSet() } @@ -138,7 +138,7 @@ func (o *NullableClass) UnsetNumberProp() { // GetBooleanProp returns the BooleanProp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableClass) GetBooleanProp() bool { - if o == nil || o.BooleanProp.Get() == nil { + if o == nil || isNil(o.BooleanProp.Get()) { var ret bool return ret } @@ -150,7 +150,7 @@ func (o *NullableClass) GetBooleanProp() bool { // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetBooleanPropOk() (*bool, bool) { if o == nil { - return nil, false + return nil, false } return o.BooleanProp.Get(), o.BooleanProp.IsSet() } @@ -180,7 +180,7 @@ func (o *NullableClass) UnsetBooleanProp() { // GetStringProp returns the StringProp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableClass) GetStringProp() string { - if o == nil || o.StringProp.Get() == nil { + if o == nil || isNil(o.StringProp.Get()) { var ret string return ret } @@ -192,7 +192,7 @@ func (o *NullableClass) GetStringProp() string { // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetStringPropOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return o.StringProp.Get(), o.StringProp.IsSet() } @@ -222,7 +222,7 @@ func (o *NullableClass) UnsetStringProp() { // GetDateProp returns the DateProp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableClass) GetDateProp() string { - if o == nil || o.DateProp.Get() == nil { + if o == nil || isNil(o.DateProp.Get()) { var ret string return ret } @@ -234,7 +234,7 @@ func (o *NullableClass) GetDateProp() string { // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetDatePropOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return o.DateProp.Get(), o.DateProp.IsSet() } @@ -264,7 +264,7 @@ func (o *NullableClass) UnsetDateProp() { // GetDatetimeProp returns the DatetimeProp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NullableClass) GetDatetimeProp() time.Time { - if o == nil || o.DatetimeProp.Get() == nil { + if o == nil || isNil(o.DatetimeProp.Get()) { var ret time.Time return ret } @@ -276,7 +276,7 @@ func (o *NullableClass) GetDatetimeProp() time.Time { // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetDatetimePropOk() (*time.Time, bool) { if o == nil { - return nil, false + return nil, false } return o.DatetimeProp.Get(), o.DatetimeProp.IsSet() } @@ -317,15 +317,15 @@ func (o *NullableClass) GetArrayNullableProp() []map[string]interface{} { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetArrayNullablePropOk() ([]map[string]interface{}, bool) { - if o == nil || o.ArrayNullableProp == nil { - return nil, false + if o == nil || isNil(o.ArrayNullableProp) { + return nil, false } return o.ArrayNullableProp, true } // HasArrayNullableProp returns a boolean if a field has been set. func (o *NullableClass) HasArrayNullableProp() bool { - if o != nil && o.ArrayNullableProp != nil { + if o != nil && isNil(o.ArrayNullableProp) { return true } @@ -350,15 +350,15 @@ func (o *NullableClass) GetArrayAndItemsNullableProp() []*map[string]interface{} // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetArrayAndItemsNullablePropOk() ([]*map[string]interface{}, bool) { - if o == nil || o.ArrayAndItemsNullableProp == nil { - return nil, false + if o == nil || isNil(o.ArrayAndItemsNullableProp) { + return nil, false } return o.ArrayAndItemsNullableProp, true } // HasArrayAndItemsNullableProp returns a boolean if a field has been set. func (o *NullableClass) HasArrayAndItemsNullableProp() bool { - if o != nil && o.ArrayAndItemsNullableProp != nil { + if o != nil && isNil(o.ArrayAndItemsNullableProp) { return true } @@ -372,7 +372,7 @@ func (o *NullableClass) SetArrayAndItemsNullableProp(v []*map[string]interface{} // GetArrayItemsNullable returns the ArrayItemsNullable field value if set, zero value otherwise. func (o *NullableClass) GetArrayItemsNullable() []*map[string]interface{} { - if o == nil || o.ArrayItemsNullable == nil { + if o == nil || isNil(o.ArrayItemsNullable) { var ret []*map[string]interface{} return ret } @@ -382,15 +382,15 @@ func (o *NullableClass) GetArrayItemsNullable() []*map[string]interface{} { // GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *NullableClass) GetArrayItemsNullableOk() ([]*map[string]interface{}, bool) { - if o == nil || o.ArrayItemsNullable == nil { - return nil, false + if o == nil || isNil(o.ArrayItemsNullable) { + return nil, false } return o.ArrayItemsNullable, true } // HasArrayItemsNullable returns a boolean if a field has been set. func (o *NullableClass) HasArrayItemsNullable() bool { - if o != nil && o.ArrayItemsNullable != nil { + if o != nil && !isNil(o.ArrayItemsNullable) { return true } @@ -415,15 +415,15 @@ func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{ // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetObjectNullablePropOk() (map[string]map[string]interface{}, bool) { - if o == nil || o.ObjectNullableProp == nil { - return nil, false + if o == nil || isNil(o.ObjectNullableProp) { + return map[string]map[string]interface{}{}, false } return o.ObjectNullableProp, true } // HasObjectNullableProp returns a boolean if a field has been set. func (o *NullableClass) HasObjectNullableProp() bool { - if o != nil && o.ObjectNullableProp != nil { + if o != nil && isNil(o.ObjectNullableProp) { return true } @@ -448,15 +448,15 @@ func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]in // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *NullableClass) GetObjectAndItemsNullablePropOk() (map[string]map[string]interface{}, bool) { - if o == nil || o.ObjectAndItemsNullableProp == nil { - return nil, false + if o == nil || isNil(o.ObjectAndItemsNullableProp) { + return map[string]map[string]interface{}{}, false } return o.ObjectAndItemsNullableProp, true } // HasObjectAndItemsNullableProp returns a boolean if a field has been set. func (o *NullableClass) HasObjectAndItemsNullableProp() bool { - if o != nil && o.ObjectAndItemsNullableProp != nil { + if o != nil && isNil(o.ObjectAndItemsNullableProp) { return true } @@ -470,7 +470,7 @@ func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]in // GetObjectItemsNullable returns the ObjectItemsNullable field value if set, zero value otherwise. func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface{} { - if o == nil || o.ObjectItemsNullable == nil { + if o == nil || isNil(o.ObjectItemsNullable) { var ret map[string]map[string]interface{} return ret } @@ -480,15 +480,15 @@ func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface // GetObjectItemsNullableOk returns a tuple with the ObjectItemsNullable field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *NullableClass) GetObjectItemsNullableOk() (map[string]map[string]interface{}, bool) { - if o == nil || o.ObjectItemsNullable == nil { - return nil, false + if o == nil || isNil(o.ObjectItemsNullable) { + return map[string]map[string]interface{}{}, false } return o.ObjectItemsNullable, true } // HasObjectItemsNullable returns a boolean if a field has been set. func (o *NullableClass) HasObjectItemsNullable() bool { - if o != nil && o.ObjectItemsNullable != nil { + if o != nil && !isNil(o.ObjectItemsNullable) { return true } @@ -526,7 +526,7 @@ func (o NullableClass) MarshalJSON() ([]byte, error) { if o.ArrayAndItemsNullableProp != nil { toSerialize["array_and_items_nullable_prop"] = o.ArrayAndItemsNullableProp } - if o.ArrayItemsNullable != nil { + if !isNil(o.ArrayItemsNullable) { toSerialize["array_items_nullable"] = o.ArrayItemsNullable } if o.ObjectNullableProp != nil { @@ -535,7 +535,7 @@ func (o NullableClass) MarshalJSON() ([]byte, error) { if o.ObjectAndItemsNullableProp != nil { toSerialize["object_and_items_nullable_prop"] = o.ObjectAndItemsNullableProp } - if o.ObjectItemsNullable != nil { + if !isNil(o.ObjectItemsNullable) { toSerialize["object_items_nullable"] = o.ObjectItemsNullable } return json.Marshal(toSerialize) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go index bf811e6a573..12a0b61b7f2 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go @@ -41,7 +41,7 @@ func NewNumberOnlyWithDefaults() *NumberOnly { // GetJustNumber returns the JustNumber field value if set, zero value otherwise. func (o *NumberOnly) GetJustNumber() float32 { - if o == nil || o.JustNumber == nil { + if o == nil || isNil(o.JustNumber) { var ret float32 return ret } @@ -51,15 +51,15 @@ func (o *NumberOnly) GetJustNumber() float32 { // GetJustNumberOk returns a tuple with the JustNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *NumberOnly) GetJustNumberOk() (*float32, bool) { - if o == nil || o.JustNumber == nil { - return nil, false + if o == nil || isNil(o.JustNumber) { + return nil, false } return o.JustNumber, true } // HasJustNumber returns a boolean if a field has been set. func (o *NumberOnly) HasJustNumber() bool { - if o != nil && o.JustNumber != nil { + if o != nil && !isNil(o.JustNumber) { return true } @@ -73,7 +73,7 @@ func (o *NumberOnly) SetJustNumber(v float32) { func (o NumberOnly) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.JustNumber != nil { + if !isNil(o.JustNumber) { toSerialize["JustNumber"] = o.JustNumber } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go index dd008dfc150..fc8ba677f68 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type.go @@ -93,11 +93,11 @@ func (dst *OneOfPrimitiveType) UnmarshalJSON(data []byte) error { dst.ArrayOfString = nil dst.Int32 = nil - return fmt.Errorf("Data matches more than one schema in oneOf(OneOfPrimitiveType)") + return fmt.Errorf("data matches more than one schema in oneOf(OneOfPrimitiveType)") } else if match == 1 { return nil // exactly one match } else { // no match - return fmt.Errorf("Data failed to match schemas in oneOf(OneOfPrimitiveType)") + return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveType)") } } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type_child.go b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type_child.go index 0d1f54271cd..49ee36631cd 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type_child.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_type_child.go @@ -41,7 +41,7 @@ func NewOneOfPrimitiveTypeChildWithDefaults() *OneOfPrimitiveTypeChild { // GetName returns the Name field value if set, zero value otherwise. func (o *OneOfPrimitiveTypeChild) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -51,15 +51,15 @@ func (o *OneOfPrimitiveTypeChild) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OneOfPrimitiveTypeChild) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *OneOfPrimitiveTypeChild) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -73,7 +73,7 @@ func (o *OneOfPrimitiveTypeChild) SetName(v string) { func (o OneOfPrimitiveTypeChild) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go new file mode 100644 index 00000000000..767f08946d2 --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/model_one_of_primitive_types.go @@ -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: \" \\ + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package petstore + +import ( + "encoding/json" + "time" + "fmt" +) + +// OneOfPrimitiveTypes - struct for OneOfPrimitiveTypes +type OneOfPrimitiveTypes struct { + String *string + TimeTime *time.Time +} + +// stringAsOneOfPrimitiveTypes is a convenience function that returns string wrapped in OneOfPrimitiveTypes +func StringAsOneOfPrimitiveTypes(v *string) OneOfPrimitiveTypes { + return OneOfPrimitiveTypes{ + String: v, + } +} + +// time.TimeAsOneOfPrimitiveTypes is a convenience function that returns time.Time wrapped in OneOfPrimitiveTypes +func TimeTimeAsOneOfPrimitiveTypes(v *time.Time) OneOfPrimitiveTypes { + return OneOfPrimitiveTypes{ + TimeTime: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *OneOfPrimitiveTypes) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + // try to unmarshal data into TimeTime + err = newStrictDecoder(data).Decode(&dst.TimeTime) + if err == nil { + jsonTimeTime, _ := json.Marshal(dst.TimeTime) + if string(jsonTimeTime) == "{}" { // empty struct + dst.TimeTime = nil + } else { + match++ + } + } else { + dst.TimeTime = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.String = nil + dst.TimeTime = nil + + return fmt.Errorf("data matches more than one schema in oneOf(OneOfPrimitiveTypes)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(OneOfPrimitiveTypes)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src OneOfPrimitiveTypes) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + if src.TimeTime != nil { + return json.Marshal(&src.TimeTime) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *OneOfPrimitiveTypes) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + if obj.TimeTime != nil { + return obj.TimeTime + } + + // all schemas are nil + return nil +} + +type NullableOneOfPrimitiveTypes struct { + value *OneOfPrimitiveTypes + isSet bool +} + +func (v NullableOneOfPrimitiveTypes) Get() *OneOfPrimitiveTypes { + return v.value +} + +func (v *NullableOneOfPrimitiveTypes) Set(val *OneOfPrimitiveTypes) { + v.value = val + v.isSet = true +} + +func (v NullableOneOfPrimitiveTypes) IsSet() bool { + return v.isSet +} + +func (v *NullableOneOfPrimitiveTypes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOneOfPrimitiveTypes(val *OneOfPrimitiveTypes) *NullableOneOfPrimitiveTypes { + return &NullableOneOfPrimitiveTypes{value: val, isSet: true} +} + +func (v NullableOneOfPrimitiveTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOneOfPrimitiveTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_order.go b/samples/openapi3/client/petstore/go/go-petstore/model_order.go index bd72e6f6365..4cc42b7a5b1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_order.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_order.go @@ -52,7 +52,7 @@ func NewOrderWithDefaults() *Order { // GetId returns the Id field value if set, zero value otherwise. func (o *Order) GetId() int64 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int64 return ret } @@ -62,15 +62,15 @@ func (o *Order) GetId() int64 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *Order) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -84,7 +84,7 @@ func (o *Order) SetId(v int64) { // GetPetId returns the PetId field value if set, zero value otherwise. func (o *Order) GetPetId() int64 { - if o == nil || o.PetId == nil { + if o == nil || isNil(o.PetId) { var ret int64 return ret } @@ -94,15 +94,15 @@ func (o *Order) GetPetId() int64 { // GetPetIdOk returns a tuple with the PetId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetPetIdOk() (*int64, bool) { - if o == nil || o.PetId == nil { - return nil, false + if o == nil || isNil(o.PetId) { + return nil, false } return o.PetId, true } // HasPetId returns a boolean if a field has been set. func (o *Order) HasPetId() bool { - if o != nil && o.PetId != nil { + if o != nil && !isNil(o.PetId) { return true } @@ -116,7 +116,7 @@ func (o *Order) SetPetId(v int64) { // GetQuantity returns the Quantity field value if set, zero value otherwise. func (o *Order) GetQuantity() int32 { - if o == nil || o.Quantity == nil { + if o == nil || isNil(o.Quantity) { var ret int32 return ret } @@ -126,15 +126,15 @@ func (o *Order) GetQuantity() int32 { // GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetQuantityOk() (*int32, bool) { - if o == nil || o.Quantity == nil { - return nil, false + if o == nil || isNil(o.Quantity) { + return nil, false } return o.Quantity, true } // HasQuantity returns a boolean if a field has been set. func (o *Order) HasQuantity() bool { - if o != nil && o.Quantity != nil { + if o != nil && !isNil(o.Quantity) { return true } @@ -148,7 +148,7 @@ func (o *Order) SetQuantity(v int32) { // GetShipDate returns the ShipDate field value if set, zero value otherwise. func (o *Order) GetShipDate() time.Time { - if o == nil || o.ShipDate == nil { + if o == nil || isNil(o.ShipDate) { var ret time.Time return ret } @@ -158,15 +158,15 @@ func (o *Order) GetShipDate() time.Time { // GetShipDateOk returns a tuple with the ShipDate field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetShipDateOk() (*time.Time, bool) { - if o == nil || o.ShipDate == nil { - return nil, false + if o == nil || isNil(o.ShipDate) { + return nil, false } return o.ShipDate, true } // HasShipDate returns a boolean if a field has been set. func (o *Order) HasShipDate() bool { - if o != nil && o.ShipDate != nil { + if o != nil && !isNil(o.ShipDate) { return true } @@ -180,7 +180,7 @@ func (o *Order) SetShipDate(v time.Time) { // GetStatus returns the Status field value if set, zero value otherwise. func (o *Order) GetStatus() string { - if o == nil || o.Status == nil { + if o == nil || isNil(o.Status) { var ret string return ret } @@ -190,15 +190,15 @@ func (o *Order) GetStatus() string { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false + if o == nil || isNil(o.Status) { + return nil, false } return o.Status, true } // HasStatus returns a boolean if a field has been set. func (o *Order) HasStatus() bool { - if o != nil && o.Status != nil { + if o != nil && !isNil(o.Status) { return true } @@ -212,7 +212,7 @@ func (o *Order) SetStatus(v string) { // GetComplete returns the Complete field value if set, zero value otherwise. func (o *Order) GetComplete() bool { - if o == nil || o.Complete == nil { + if o == nil || isNil(o.Complete) { var ret bool return ret } @@ -222,15 +222,15 @@ func (o *Order) GetComplete() bool { // GetCompleteOk returns a tuple with the Complete field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Order) GetCompleteOk() (*bool, bool) { - if o == nil || o.Complete == nil { - return nil, false + if o == nil || isNil(o.Complete) { + return nil, false } return o.Complete, true } // HasComplete returns a boolean if a field has been set. func (o *Order) HasComplete() bool { - if o != nil && o.Complete != nil { + if o != nil && !isNil(o.Complete) { return true } @@ -244,22 +244,22 @@ func (o *Order) SetComplete(v bool) { func (o Order) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !isNil(o.Id) { toSerialize["id"] = o.Id } - if o.PetId != nil { + if !isNil(o.PetId) { toSerialize["petId"] = o.PetId } - if o.Quantity != nil { + if !isNil(o.Quantity) { toSerialize["quantity"] = o.Quantity } - if o.ShipDate != nil { + if !isNil(o.ShipDate) { toSerialize["shipDate"] = o.ShipDate } - if o.Status != nil { + if !isNil(o.Status) { toSerialize["status"] = o.Status } - if o.Complete != nil { + if !isNil(o.Complete) { toSerialize["complete"] = o.Complete } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go index 6fad0ae7dca..aaa82cf01d4 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go @@ -43,7 +43,7 @@ func NewOuterCompositeWithDefaults() *OuterComposite { // GetMyNumber returns the MyNumber field value if set, zero value otherwise. func (o *OuterComposite) GetMyNumber() float32 { - if o == nil || o.MyNumber == nil { + if o == nil || isNil(o.MyNumber) { var ret float32 return ret } @@ -53,15 +53,15 @@ func (o *OuterComposite) GetMyNumber() float32 { // GetMyNumberOk returns a tuple with the MyNumber field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OuterComposite) GetMyNumberOk() (*float32, bool) { - if o == nil || o.MyNumber == nil { - return nil, false + if o == nil || isNil(o.MyNumber) { + return nil, false } return o.MyNumber, true } // HasMyNumber returns a boolean if a field has been set. func (o *OuterComposite) HasMyNumber() bool { - if o != nil && o.MyNumber != nil { + if o != nil && !isNil(o.MyNumber) { return true } @@ -75,7 +75,7 @@ func (o *OuterComposite) SetMyNumber(v float32) { // GetMyString returns the MyString field value if set, zero value otherwise. func (o *OuterComposite) GetMyString() string { - if o == nil || o.MyString == nil { + if o == nil || isNil(o.MyString) { var ret string return ret } @@ -85,15 +85,15 @@ func (o *OuterComposite) GetMyString() string { // GetMyStringOk returns a tuple with the MyString field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OuterComposite) GetMyStringOk() (*string, bool) { - if o == nil || o.MyString == nil { - return nil, false + if o == nil || isNil(o.MyString) { + return nil, false } return o.MyString, true } // HasMyString returns a boolean if a field has been set. func (o *OuterComposite) HasMyString() bool { - if o != nil && o.MyString != nil { + if o != nil && !isNil(o.MyString) { return true } @@ -107,7 +107,7 @@ func (o *OuterComposite) SetMyString(v string) { // GetMyBoolean returns the MyBoolean field value if set, zero value otherwise. func (o *OuterComposite) GetMyBoolean() bool { - if o == nil || o.MyBoolean == nil { + if o == nil || isNil(o.MyBoolean) { var ret bool return ret } @@ -117,15 +117,15 @@ func (o *OuterComposite) GetMyBoolean() bool { // GetMyBooleanOk returns a tuple with the MyBoolean field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OuterComposite) GetMyBooleanOk() (*bool, bool) { - if o == nil || o.MyBoolean == nil { - return nil, false + if o == nil || isNil(o.MyBoolean) { + return nil, false } return o.MyBoolean, true } // HasMyBoolean returns a boolean if a field has been set. func (o *OuterComposite) HasMyBoolean() bool { - if o != nil && o.MyBoolean != nil { + if o != nil && !isNil(o.MyBoolean) { return true } @@ -139,13 +139,13 @@ func (o *OuterComposite) SetMyBoolean(v bool) { func (o OuterComposite) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.MyNumber != nil { + if !isNil(o.MyNumber) { toSerialize["my_number"] = o.MyNumber } - if o.MyString != nil { + if !isNil(o.MyString) { toSerialize["my_string"] = o.MyString } - if o.MyBoolean != nil { + if !isNil(o.MyBoolean) { toSerialize["my_boolean"] = o.MyBoolean } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go index f4ed04820c8..f0a086d7f3f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go @@ -50,7 +50,7 @@ func NewPetWithDefaults() *Pet { // GetId returns the Id field value if set, zero value otherwise. func (o *Pet) GetId() int64 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int64 return ret } @@ -60,15 +60,15 @@ func (o *Pet) GetId() int64 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pet) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *Pet) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -82,7 +82,7 @@ func (o *Pet) SetId(v int64) { // GetCategory returns the Category field value if set, zero value otherwise. func (o *Pet) GetCategory() Category { - if o == nil || o.Category == nil { + if o == nil || isNil(o.Category) { var ret Category return ret } @@ -92,15 +92,15 @@ func (o *Pet) GetCategory() Category { // GetCategoryOk returns a tuple with the Category field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pet) GetCategoryOk() (*Category, bool) { - if o == nil || o.Category == nil { - return nil, false + if o == nil || isNil(o.Category) { + return nil, false } return o.Category, true } // HasCategory returns a boolean if a field has been set. func (o *Pet) HasCategory() bool { - if o != nil && o.Category != nil { + if o != nil && !isNil(o.Category) { return true } @@ -126,7 +126,7 @@ func (o *Pet) GetName() string { // and a boolean to check if the value has been set. func (o *Pet) GetNameOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.Name, true } @@ -150,7 +150,7 @@ func (o *Pet) GetPhotoUrls() []string { // and a boolean to check if the value has been set. func (o *Pet) GetPhotoUrlsOk() ([]string, bool) { if o == nil { - return nil, false + return nil, false } return o.PhotoUrls, true } @@ -162,7 +162,7 @@ func (o *Pet) SetPhotoUrls(v []string) { // GetTags returns the Tags field value if set, zero value otherwise. func (o *Pet) GetTags() []Tag { - if o == nil || o.Tags == nil { + if o == nil || isNil(o.Tags) { var ret []Tag return ret } @@ -172,15 +172,15 @@ func (o *Pet) GetTags() []Tag { // GetTagsOk returns a tuple with the Tags field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pet) GetTagsOk() ([]Tag, bool) { - if o == nil || o.Tags == nil { - return nil, false + if o == nil || isNil(o.Tags) { + return nil, false } return o.Tags, true } // HasTags returns a boolean if a field has been set. func (o *Pet) HasTags() bool { - if o != nil && o.Tags != nil { + if o != nil && !isNil(o.Tags) { return true } @@ -195,7 +195,7 @@ func (o *Pet) SetTags(v []Tag) { // GetStatus returns the Status field value if set, zero value otherwise. // Deprecated func (o *Pet) GetStatus() string { - if o == nil || o.Status == nil { + if o == nil || isNil(o.Status) { var ret string return ret } @@ -206,15 +206,15 @@ func (o *Pet) GetStatus() string { // and a boolean to check if the value has been set. // Deprecated func (o *Pet) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false + if o == nil || isNil(o.Status) { + return nil, false } return o.Status, true } // HasStatus returns a boolean if a field has been set. func (o *Pet) HasStatus() bool { - if o != nil && o.Status != nil { + if o != nil && !isNil(o.Status) { return true } @@ -229,10 +229,10 @@ func (o *Pet) SetStatus(v string) { func (o Pet) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !isNil(o.Id) { toSerialize["id"] = o.Id } - if o.Category != nil { + if !isNil(o.Category) { toSerialize["category"] = o.Category } if true { @@ -241,10 +241,10 @@ func (o Pet) MarshalJSON() ([]byte, error) { if true { toSerialize["photoUrls"] = o.PhotoUrls } - if o.Tags != nil { + if !isNil(o.Tags) { toSerialize["tags"] = o.Tags } - if o.Status != nil { + if !isNil(o.Status) { toSerialize["status"] = o.Status } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go b/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go index eed30450bc0..bebaf5ac671 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go @@ -42,7 +42,7 @@ func NewReadOnlyFirstWithDefaults() *ReadOnlyFirst { // GetBar returns the Bar field value if set, zero value otherwise. func (o *ReadOnlyFirst) GetBar() string { - if o == nil || o.Bar == nil { + if o == nil || isNil(o.Bar) { var ret string return ret } @@ -52,15 +52,15 @@ func (o *ReadOnlyFirst) GetBar() string { // GetBarOk returns a tuple with the Bar field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyFirst) GetBarOk() (*string, bool) { - if o == nil || o.Bar == nil { - return nil, false + if o == nil || isNil(o.Bar) { + return nil, false } return o.Bar, true } // HasBar returns a boolean if a field has been set. func (o *ReadOnlyFirst) HasBar() bool { - if o != nil && o.Bar != nil { + if o != nil && !isNil(o.Bar) { return true } @@ -74,7 +74,7 @@ func (o *ReadOnlyFirst) SetBar(v string) { // GetBaz returns the Baz field value if set, zero value otherwise. func (o *ReadOnlyFirst) GetBaz() string { - if o == nil || o.Baz == nil { + if o == nil || isNil(o.Baz) { var ret string return ret } @@ -84,15 +84,15 @@ func (o *ReadOnlyFirst) GetBaz() string { // GetBazOk returns a tuple with the Baz field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyFirst) GetBazOk() (*string, bool) { - if o == nil || o.Baz == nil { - return nil, false + if o == nil || isNil(o.Baz) { + return nil, false } return o.Baz, true } // HasBaz returns a boolean if a field has been set. func (o *ReadOnlyFirst) HasBaz() bool { - if o != nil && o.Baz != nil { + if o != nil && !isNil(o.Baz) { return true } @@ -106,10 +106,10 @@ func (o *ReadOnlyFirst) SetBaz(v string) { func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Bar != nil { + if !isNil(o.Bar) { toSerialize["bar"] = o.Bar } - if o.Baz != nil { + if !isNil(o.Baz) { toSerialize["baz"] = o.Baz } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_read_only_with_default.go b/samples/openapi3/client/petstore/go/go-petstore/model_read_only_with_default.go index 180b446f810..2b82163ca7c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_read_only_with_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_read_only_with_default.go @@ -59,7 +59,7 @@ func NewReadOnlyWithDefaultWithDefaults() *ReadOnlyWithDefault { // GetProp1 returns the Prop1 field value if set, zero value otherwise. func (o *ReadOnlyWithDefault) GetProp1() string { - if o == nil || o.Prop1 == nil { + if o == nil || isNil(o.Prop1) { var ret string return ret } @@ -69,15 +69,15 @@ func (o *ReadOnlyWithDefault) GetProp1() string { // GetProp1Ok returns a tuple with the Prop1 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyWithDefault) GetProp1Ok() (*string, bool) { - if o == nil || o.Prop1 == nil { - return nil, false + if o == nil || isNil(o.Prop1) { + return nil, false } return o.Prop1, true } // HasProp1 returns a boolean if a field has been set. func (o *ReadOnlyWithDefault) HasProp1() bool { - if o != nil && o.Prop1 != nil { + if o != nil && !isNil(o.Prop1) { return true } @@ -91,7 +91,7 @@ func (o *ReadOnlyWithDefault) SetProp1(v string) { // GetProp2 returns the Prop2 field value if set, zero value otherwise. func (o *ReadOnlyWithDefault) GetProp2() string { - if o == nil || o.Prop2 == nil { + if o == nil || isNil(o.Prop2) { var ret string return ret } @@ -101,15 +101,15 @@ func (o *ReadOnlyWithDefault) GetProp2() string { // GetProp2Ok returns a tuple with the Prop2 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyWithDefault) GetProp2Ok() (*string, bool) { - if o == nil || o.Prop2 == nil { - return nil, false + if o == nil || isNil(o.Prop2) { + return nil, false } return o.Prop2, true } // HasProp2 returns a boolean if a field has been set. func (o *ReadOnlyWithDefault) HasProp2() bool { - if o != nil && o.Prop2 != nil { + if o != nil && !isNil(o.Prop2) { return true } @@ -123,7 +123,7 @@ func (o *ReadOnlyWithDefault) SetProp2(v string) { // GetProp3 returns the Prop3 field value if set, zero value otherwise. func (o *ReadOnlyWithDefault) GetProp3() string { - if o == nil || o.Prop3 == nil { + if o == nil || isNil(o.Prop3) { var ret string return ret } @@ -133,15 +133,15 @@ func (o *ReadOnlyWithDefault) GetProp3() string { // GetProp3Ok returns a tuple with the Prop3 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyWithDefault) GetProp3Ok() (*string, bool) { - if o == nil || o.Prop3 == nil { - return nil, false + if o == nil || isNil(o.Prop3) { + return nil, false } return o.Prop3, true } // HasProp3 returns a boolean if a field has been set. func (o *ReadOnlyWithDefault) HasProp3() bool { - if o != nil && o.Prop3 != nil { + if o != nil && !isNil(o.Prop3) { return true } @@ -155,7 +155,7 @@ func (o *ReadOnlyWithDefault) SetProp3(v string) { // GetBoolProp1 returns the BoolProp1 field value if set, zero value otherwise. func (o *ReadOnlyWithDefault) GetBoolProp1() bool { - if o == nil || o.BoolProp1 == nil { + if o == nil || isNil(o.BoolProp1) { var ret bool return ret } @@ -165,15 +165,15 @@ func (o *ReadOnlyWithDefault) GetBoolProp1() bool { // GetBoolProp1Ok returns a tuple with the BoolProp1 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyWithDefault) GetBoolProp1Ok() (*bool, bool) { - if o == nil || o.BoolProp1 == nil { - return nil, false + if o == nil || isNil(o.BoolProp1) { + return nil, false } return o.BoolProp1, true } // HasBoolProp1 returns a boolean if a field has been set. func (o *ReadOnlyWithDefault) HasBoolProp1() bool { - if o != nil && o.BoolProp1 != nil { + if o != nil && !isNil(o.BoolProp1) { return true } @@ -187,7 +187,7 @@ func (o *ReadOnlyWithDefault) SetBoolProp1(v bool) { // GetBoolProp2 returns the BoolProp2 field value if set, zero value otherwise. func (o *ReadOnlyWithDefault) GetBoolProp2() bool { - if o == nil || o.BoolProp2 == nil { + if o == nil || isNil(o.BoolProp2) { var ret bool return ret } @@ -197,15 +197,15 @@ func (o *ReadOnlyWithDefault) GetBoolProp2() bool { // GetBoolProp2Ok returns a tuple with the BoolProp2 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyWithDefault) GetBoolProp2Ok() (*bool, bool) { - if o == nil || o.BoolProp2 == nil { - return nil, false + if o == nil || isNil(o.BoolProp2) { + return nil, false } return o.BoolProp2, true } // HasBoolProp2 returns a boolean if a field has been set. func (o *ReadOnlyWithDefault) HasBoolProp2() bool { - if o != nil && o.BoolProp2 != nil { + if o != nil && !isNil(o.BoolProp2) { return true } @@ -219,7 +219,7 @@ func (o *ReadOnlyWithDefault) SetBoolProp2(v bool) { // GetIntProp1 returns the IntProp1 field value if set, zero value otherwise. func (o *ReadOnlyWithDefault) GetIntProp1() float32 { - if o == nil || o.IntProp1 == nil { + if o == nil || isNil(o.IntProp1) { var ret float32 return ret } @@ -229,15 +229,15 @@ func (o *ReadOnlyWithDefault) GetIntProp1() float32 { // GetIntProp1Ok returns a tuple with the IntProp1 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyWithDefault) GetIntProp1Ok() (*float32, bool) { - if o == nil || o.IntProp1 == nil { - return nil, false + if o == nil || isNil(o.IntProp1) { + return nil, false } return o.IntProp1, true } // HasIntProp1 returns a boolean if a field has been set. func (o *ReadOnlyWithDefault) HasIntProp1() bool { - if o != nil && o.IntProp1 != nil { + if o != nil && !isNil(o.IntProp1) { return true } @@ -251,7 +251,7 @@ func (o *ReadOnlyWithDefault) SetIntProp1(v float32) { // GetIntProp2 returns the IntProp2 field value if set, zero value otherwise. func (o *ReadOnlyWithDefault) GetIntProp2() float32 { - if o == nil || o.IntProp2 == nil { + if o == nil || isNil(o.IntProp2) { var ret float32 return ret } @@ -261,15 +261,15 @@ func (o *ReadOnlyWithDefault) GetIntProp2() float32 { // GetIntProp2Ok returns a tuple with the IntProp2 field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadOnlyWithDefault) GetIntProp2Ok() (*float32, bool) { - if o == nil || o.IntProp2 == nil { - return nil, false + if o == nil || isNil(o.IntProp2) { + return nil, false } return o.IntProp2, true } // HasIntProp2 returns a boolean if a field has been set. func (o *ReadOnlyWithDefault) HasIntProp2() bool { - if o != nil && o.IntProp2 != nil { + if o != nil && !isNil(o.IntProp2) { return true } @@ -283,25 +283,25 @@ func (o *ReadOnlyWithDefault) SetIntProp2(v float32) { func (o ReadOnlyWithDefault) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Prop1 != nil { + if !isNil(o.Prop1) { toSerialize["prop1"] = o.Prop1 } - if o.Prop2 != nil { + if !isNil(o.Prop2) { toSerialize["prop2"] = o.Prop2 } - if o.Prop3 != nil { + if !isNil(o.Prop3) { toSerialize["prop3"] = o.Prop3 } - if o.BoolProp1 != nil { + if !isNil(o.BoolProp1) { toSerialize["boolProp1"] = o.BoolProp1 } - if o.BoolProp2 != nil { + if !isNil(o.BoolProp2) { toSerialize["boolProp2"] = o.BoolProp2 } - if o.IntProp1 != nil { + if !isNil(o.IntProp1) { toSerialize["intProp1"] = o.IntProp1 } - if o.IntProp2 != nil { + if !isNil(o.IntProp2) { toSerialize["intProp2"] = o.IntProp2 } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_return.go b/samples/openapi3/client/petstore/go/go-petstore/model_return.go index 1752b15d24a..cafa2b58861 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_return.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_return.go @@ -41,7 +41,7 @@ func NewReturnWithDefaults() *Return { // GetReturn returns the Return field value if set, zero value otherwise. func (o *Return) GetReturn() int32 { - if o == nil || o.Return == nil { + if o == nil || isNil(o.Return) { var ret int32 return ret } @@ -51,15 +51,15 @@ func (o *Return) GetReturn() int32 { // GetReturnOk returns a tuple with the Return field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Return) GetReturnOk() (*int32, bool) { - if o == nil || o.Return == nil { - return nil, false + if o == nil || isNil(o.Return) { + return nil, false } return o.Return, true } // HasReturn returns a boolean if a field has been set. func (o *Return) HasReturn() bool { - if o != nil && o.Return != nil { + if o != nil && !isNil(o.Return) { return true } @@ -73,7 +73,7 @@ func (o *Return) SetReturn(v int32) { func (o Return) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Return != nil { + if !isNil(o.Return) { toSerialize["return"] = o.Return } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_tag.go b/samples/openapi3/client/petstore/go/go-petstore/model_tag.go index c7b20ccb32c..6e91817d4be 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_tag.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_tag.go @@ -42,7 +42,7 @@ func NewTagWithDefaults() *Tag { // GetId returns the Id field value if set, zero value otherwise. func (o *Tag) GetId() int64 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int64 return ret } @@ -52,15 +52,15 @@ func (o *Tag) GetId() int64 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Tag) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *Tag) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -74,7 +74,7 @@ func (o *Tag) SetId(v int64) { // GetName returns the Name field value if set, zero value otherwise. func (o *Tag) GetName() string { - if o == nil || o.Name == nil { + if o == nil || isNil(o.Name) { var ret string return ret } @@ -84,15 +84,15 @@ func (o *Tag) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Tag) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false + if o == nil || isNil(o.Name) { + return nil, false } return o.Name, true } // HasName returns a boolean if a field has been set. func (o *Tag) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !isNil(o.Name) { return true } @@ -106,10 +106,10 @@ func (o *Tag) SetName(v string) { func (o Tag) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !isNil(o.Id) { toSerialize["id"] = o.Id } - if o.Name != nil { + if !isNil(o.Name) { toSerialize["name"] = o.Name } diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_user.go b/samples/openapi3/client/petstore/go/go-petstore/model_user.go index 831790bdb62..321ae5e03b1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_user.go @@ -57,7 +57,7 @@ func NewUserWithDefaults() *User { // GetId returns the Id field value if set, zero value otherwise. func (o *User) GetId() int64 { - if o == nil || o.Id == nil { + if o == nil || isNil(o.Id) { var ret int64 return ret } @@ -67,15 +67,15 @@ func (o *User) GetId() int64 { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false + if o == nil || isNil(o.Id) { + return nil, false } return o.Id, true } // HasId returns a boolean if a field has been set. func (o *User) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && !isNil(o.Id) { return true } @@ -89,7 +89,7 @@ func (o *User) SetId(v int64) { // GetUsername returns the Username field value if set, zero value otherwise. func (o *User) GetUsername() string { - if o == nil || o.Username == nil { + if o == nil || isNil(o.Username) { var ret string return ret } @@ -99,15 +99,15 @@ func (o *User) GetUsername() string { // GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetUsernameOk() (*string, bool) { - if o == nil || o.Username == nil { - return nil, false + if o == nil || isNil(o.Username) { + return nil, false } return o.Username, true } // HasUsername returns a boolean if a field has been set. func (o *User) HasUsername() bool { - if o != nil && o.Username != nil { + if o != nil && !isNil(o.Username) { return true } @@ -121,7 +121,7 @@ func (o *User) SetUsername(v string) { // GetFirstName returns the FirstName field value if set, zero value otherwise. func (o *User) GetFirstName() string { - if o == nil || o.FirstName == nil { + if o == nil || isNil(o.FirstName) { var ret string return ret } @@ -131,15 +131,15 @@ func (o *User) GetFirstName() string { // GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetFirstNameOk() (*string, bool) { - if o == nil || o.FirstName == nil { - return nil, false + if o == nil || isNil(o.FirstName) { + return nil, false } return o.FirstName, true } // HasFirstName returns a boolean if a field has been set. func (o *User) HasFirstName() bool { - if o != nil && o.FirstName != nil { + if o != nil && !isNil(o.FirstName) { return true } @@ -153,7 +153,7 @@ func (o *User) SetFirstName(v string) { // GetLastName returns the LastName field value if set, zero value otherwise. func (o *User) GetLastName() string { - if o == nil || o.LastName == nil { + if o == nil || isNil(o.LastName) { var ret string return ret } @@ -163,15 +163,15 @@ func (o *User) GetLastName() string { // GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetLastNameOk() (*string, bool) { - if o == nil || o.LastName == nil { - return nil, false + if o == nil || isNil(o.LastName) { + return nil, false } return o.LastName, true } // HasLastName returns a boolean if a field has been set. func (o *User) HasLastName() bool { - if o != nil && o.LastName != nil { + if o != nil && !isNil(o.LastName) { return true } @@ -185,7 +185,7 @@ func (o *User) SetLastName(v string) { // GetEmail returns the Email field value if set, zero value otherwise. func (o *User) GetEmail() string { - if o == nil || o.Email == nil { + if o == nil || isNil(o.Email) { var ret string return ret } @@ -195,15 +195,15 @@ func (o *User) GetEmail() string { // GetEmailOk returns a tuple with the Email field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetEmailOk() (*string, bool) { - if o == nil || o.Email == nil { - return nil, false + if o == nil || isNil(o.Email) { + return nil, false } return o.Email, true } // HasEmail returns a boolean if a field has been set. func (o *User) HasEmail() bool { - if o != nil && o.Email != nil { + if o != nil && !isNil(o.Email) { return true } @@ -217,7 +217,7 @@ func (o *User) SetEmail(v string) { // GetPassword returns the Password field value if set, zero value otherwise. func (o *User) GetPassword() string { - if o == nil || o.Password == nil { + if o == nil || isNil(o.Password) { var ret string return ret } @@ -227,15 +227,15 @@ func (o *User) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false + if o == nil || isNil(o.Password) { + return nil, false } return o.Password, true } // HasPassword returns a boolean if a field has been set. func (o *User) HasPassword() bool { - if o != nil && o.Password != nil { + if o != nil && !isNil(o.Password) { return true } @@ -249,7 +249,7 @@ func (o *User) SetPassword(v string) { // GetPhone returns the Phone field value if set, zero value otherwise. func (o *User) GetPhone() string { - if o == nil || o.Phone == nil { + if o == nil || isNil(o.Phone) { var ret string return ret } @@ -259,15 +259,15 @@ func (o *User) GetPhone() string { // GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetPhoneOk() (*string, bool) { - if o == nil || o.Phone == nil { - return nil, false + if o == nil || isNil(o.Phone) { + return nil, false } return o.Phone, true } // HasPhone returns a boolean if a field has been set. func (o *User) HasPhone() bool { - if o != nil && o.Phone != nil { + if o != nil && !isNil(o.Phone) { return true } @@ -281,7 +281,7 @@ func (o *User) SetPhone(v string) { // GetUserStatus returns the UserStatus field value if set, zero value otherwise. func (o *User) GetUserStatus() int32 { - if o == nil || o.UserStatus == nil { + if o == nil || isNil(o.UserStatus) { var ret int32 return ret } @@ -291,15 +291,15 @@ func (o *User) GetUserStatus() int32 { // GetUserStatusOk returns a tuple with the UserStatus field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetUserStatusOk() (*int32, bool) { - if o == nil || o.UserStatus == nil { - return nil, false + if o == nil || isNil(o.UserStatus) { + return nil, false } return o.UserStatus, true } // HasUserStatus returns a boolean if a field has been set. func (o *User) HasUserStatus() bool { - if o != nil && o.UserStatus != nil { + if o != nil && !isNil(o.UserStatus) { return true } @@ -313,7 +313,7 @@ func (o *User) SetUserStatus(v int32) { // GetArbitraryObject returns the ArbitraryObject field value if set, zero value otherwise. func (o *User) GetArbitraryObject() map[string]interface{} { - if o == nil || o.ArbitraryObject == nil { + if o == nil || isNil(o.ArbitraryObject) { var ret map[string]interface{} return ret } @@ -323,15 +323,15 @@ func (o *User) GetArbitraryObject() map[string]interface{} { // GetArbitraryObjectOk returns a tuple with the ArbitraryObject field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetArbitraryObjectOk() (map[string]interface{}, bool) { - if o == nil || o.ArbitraryObject == nil { - return nil, false + if o == nil || isNil(o.ArbitraryObject) { + return map[string]interface{}{}, false } return o.ArbitraryObject, true } // HasArbitraryObject returns a boolean if a field has been set. func (o *User) HasArbitraryObject() bool { - if o != nil && o.ArbitraryObject != nil { + if o != nil && !isNil(o.ArbitraryObject) { return true } @@ -356,15 +356,15 @@ func (o *User) GetArbitraryNullableObject() map[string]interface{} { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *User) GetArbitraryNullableObjectOk() (map[string]interface{}, bool) { - if o == nil || o.ArbitraryNullableObject == nil { - return nil, false + if o == nil || isNil(o.ArbitraryNullableObject) { + return map[string]interface{}{}, false } return o.ArbitraryNullableObject, true } // HasArbitraryNullableObject returns a boolean if a field has been set. func (o *User) HasArbitraryNullableObject() bool { - if o != nil && o.ArbitraryNullableObject != nil { + if o != nil && isNil(o.ArbitraryNullableObject) { return true } @@ -389,15 +389,15 @@ func (o *User) GetArbitraryTypeValue() interface{} { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *User) GetArbitraryTypeValueOk() (*interface{}, bool) { - if o == nil || o.ArbitraryTypeValue == nil { - return nil, false + if o == nil || isNil(o.ArbitraryTypeValue) { + return nil, false } return &o.ArbitraryTypeValue, true } // HasArbitraryTypeValue returns a boolean if a field has been set. func (o *User) HasArbitraryTypeValue() bool { - if o != nil && o.ArbitraryTypeValue != nil { + if o != nil && isNil(o.ArbitraryTypeValue) { return true } @@ -422,15 +422,15 @@ func (o *User) GetArbitraryNullableTypeValue() interface{} { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *User) GetArbitraryNullableTypeValueOk() (*interface{}, bool) { - if o == nil || o.ArbitraryNullableTypeValue == nil { - return nil, false + if o == nil || isNil(o.ArbitraryNullableTypeValue) { + return nil, false } return &o.ArbitraryNullableTypeValue, true } // HasArbitraryNullableTypeValue returns a boolean if a field has been set. func (o *User) HasArbitraryNullableTypeValue() bool { - if o != nil && o.ArbitraryNullableTypeValue != nil { + if o != nil && isNil(o.ArbitraryNullableTypeValue) { return true } @@ -444,31 +444,31 @@ func (o *User) SetArbitraryNullableTypeValue(v interface{}) { func (o User) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { + if !isNil(o.Id) { toSerialize["id"] = o.Id } - if o.Username != nil { + if !isNil(o.Username) { toSerialize["username"] = o.Username } - if o.FirstName != nil { + if !isNil(o.FirstName) { toSerialize["firstName"] = o.FirstName } - if o.LastName != nil { + if !isNil(o.LastName) { toSerialize["lastName"] = o.LastName } - if o.Email != nil { + if !isNil(o.Email) { toSerialize["email"] = o.Email } - if o.Password != nil { + if !isNil(o.Password) { toSerialize["password"] = o.Password } - if o.Phone != nil { + if !isNil(o.Phone) { toSerialize["phone"] = o.Phone } - if o.UserStatus != nil { + if !isNil(o.UserStatus) { toSerialize["userStatus"] = o.UserStatus } - if o.ArbitraryObject != nil { + if !isNil(o.ArbitraryObject) { toSerialize["arbitraryObject"] = o.ArbitraryObject } if o.ArbitraryNullableObject != nil { diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_whale.go b/samples/openapi3/client/petstore/go/go-petstore/model_whale.go index 2e562647568..2b585199f94 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_whale.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_whale.go @@ -44,7 +44,7 @@ func NewWhaleWithDefaults() *Whale { // GetHasBaleen returns the HasBaleen field value if set, zero value otherwise. func (o *Whale) GetHasBaleen() bool { - if o == nil || o.HasBaleen == nil { + if o == nil || isNil(o.HasBaleen) { var ret bool return ret } @@ -54,15 +54,15 @@ func (o *Whale) GetHasBaleen() bool { // GetHasBaleenOk returns a tuple with the HasBaleen field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Whale) GetHasBaleenOk() (*bool, bool) { - if o == nil || o.HasBaleen == nil { - return nil, false + if o == nil || isNil(o.HasBaleen) { + return nil, false } return o.HasBaleen, true } // HasHasBaleen returns a boolean if a field has been set. func (o *Whale) HasHasBaleen() bool { - if o != nil && o.HasBaleen != nil { + if o != nil && !isNil(o.HasBaleen) { return true } @@ -76,7 +76,7 @@ func (o *Whale) SetHasBaleen(v bool) { // GetHasTeeth returns the HasTeeth field value if set, zero value otherwise. func (o *Whale) GetHasTeeth() bool { - if o == nil || o.HasTeeth == nil { + if o == nil || isNil(o.HasTeeth) { var ret bool return ret } @@ -86,15 +86,15 @@ func (o *Whale) GetHasTeeth() bool { // GetHasTeethOk returns a tuple with the HasTeeth field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Whale) GetHasTeethOk() (*bool, bool) { - if o == nil || o.HasTeeth == nil { - return nil, false + if o == nil || isNil(o.HasTeeth) { + return nil, false } return o.HasTeeth, true } // HasHasTeeth returns a boolean if a field has been set. func (o *Whale) HasHasTeeth() bool { - if o != nil && o.HasTeeth != nil { + if o != nil && !isNil(o.HasTeeth) { return true } @@ -120,7 +120,7 @@ func (o *Whale) GetClassName() string { // and a boolean to check if the value has been set. func (o *Whale) GetClassNameOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.ClassName, true } @@ -132,10 +132,10 @@ func (o *Whale) SetClassName(v string) { func (o Whale) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.HasBaleen != nil { + if !isNil(o.HasBaleen) { toSerialize["hasBaleen"] = o.HasBaleen } - if o.HasTeeth != nil { + if !isNil(o.HasTeeth) { toSerialize["hasTeeth"] = o.HasTeeth } if true { diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go b/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go index 0c70bc462cc..3664895873e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go @@ -43,7 +43,7 @@ func NewZebraWithDefaults() *Zebra { // GetType returns the Type field value if set, zero value otherwise. func (o *Zebra) GetType() string { - if o == nil || o.Type == nil { + if o == nil || isNil(o.Type) { var ret string return ret } @@ -53,15 +53,15 @@ func (o *Zebra) GetType() string { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Zebra) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false + if o == nil || isNil(o.Type) { + return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *Zebra) HasType() bool { - if o != nil && o.Type != nil { + if o != nil && !isNil(o.Type) { return true } @@ -87,7 +87,7 @@ func (o *Zebra) GetClassName() string { // and a boolean to check if the value has been set. func (o *Zebra) GetClassNameOk() (*string, bool) { if o == nil { - return nil, false + return nil, false } return &o.ClassName, true } @@ -99,7 +99,7 @@ func (o *Zebra) SetClassName(v string) { func (o Zebra) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Type != nil { + if !isNil(o.Type) { toSerialize["type"] = o.Type } if true { diff --git a/samples/openapi3/client/petstore/go/go-petstore/signing.go b/samples/openapi3/client/petstore/go/go-petstore/signing.go index d6dfdbb50f9..6a6a756ff14 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/signing.go +++ b/samples/openapi3/client/petstore/go/go-petstore/signing.go @@ -135,26 +135,26 @@ func (h *HttpSignatureAuth) SetPrivateKey(privateKey string) error { // are invalid. func (h *HttpSignatureAuth) ContextWithValue(ctx context.Context) (context.Context, error) { if h.KeyId == "" { - return nil, fmt.Errorf("Key ID must be specified") + return nil, fmt.Errorf("key ID must be specified") } if h.PrivateKeyPath == "" && h.privateKey == nil { - return nil, fmt.Errorf("Private key path must be specified") + return nil, fmt.Errorf("private key path must be specified") } if _, ok := supportedSigningSchemes[h.SigningScheme]; !ok { - return nil, fmt.Errorf("Invalid signing scheme: '%v'", h.SigningScheme) + return nil, fmt.Errorf("invalid signing scheme: '%v'", h.SigningScheme) } m := make(map[string]bool) for _, h := range h.SignedHeaders { if strings.EqualFold(h, HttpHeaderAuthorization) { - return nil, fmt.Errorf("Signed headers cannot include the 'Authorization' header") + return nil, fmt.Errorf("signed headers cannot include the 'Authorization' header") } m[h] = true } if len(m) != len(h.SignedHeaders) { - return nil, fmt.Errorf("List of signed headers cannot have duplicate names") + return nil, fmt.Errorf("list of signed headers cannot have duplicate names") } if h.SignatureMaxValidity < 0 { - return nil, fmt.Errorf("Signature max validity must be a positive value") + return nil, fmt.Errorf("signature max validity must be a positive value") } if err := h.loadPrivateKey(); err != nil { return nil, err @@ -177,7 +177,7 @@ func (h *HttpSignatureAuth) GetPublicKey() (crypto.PublicKey, error) { default: // Do not change '%T' to anything else such as '%v'! // The value of the private key must not be returned. - return nil, fmt.Errorf("Unsupported key: %T", h.privateKey) + return nil, fmt.Errorf("unsupported key: %T", h.privateKey) } } @@ -190,7 +190,7 @@ func (h *HttpSignatureAuth) loadPrivateKey() (err error) { var file *os.File file, err = os.Open(h.PrivateKeyPath) if err != nil { - return fmt.Errorf("Cannot load private key '%s'. Error: %v", h.PrivateKeyPath, err) + return fmt.Errorf("cannot load private key '%s'. Error: %v", h.PrivateKeyPath, err) } defer func() { err = file.Close() @@ -208,7 +208,7 @@ func (h *HttpSignatureAuth) parsePrivateKey(priv []byte) error { pemBlock, _ := pem.Decode(priv) if pemBlock == nil { // No PEM data has been found. - return fmt.Errorf("File '%s' does not contain PEM data", h.PrivateKeyPath) + return fmt.Errorf("file '%s' does not contain PEM data", h.PrivateKeyPath) } var privKey []byte var err error @@ -234,7 +234,7 @@ func (h *HttpSignatureAuth) parsePrivateKey(priv []byte) error { return err } default: - return fmt.Errorf("Key '%s' is not supported", pemBlock.Type) + return fmt.Errorf("key '%s' is not supported", pemBlock.Type) } return nil } @@ -257,7 +257,7 @@ func SignRequest( auth HttpSignatureAuth) error { if auth.privateKey == nil { - return fmt.Errorf("Private key is not set") + return fmt.Errorf("private key is not set") } now := time.Now() date := now.UTC().Format(http.TimeFormat) @@ -271,7 +271,7 @@ func SignRequest( var expiresUnix float64 if auth.SignatureMaxValidity < 0 { - return fmt.Errorf("Signature validity must be a positive value") + return fmt.Errorf("signature validity must be a positive value") } if auth.SignatureMaxValidity > 0 { e := now.Add(auth.SignatureMaxValidity) @@ -287,10 +287,10 @@ func SignRequest( h = crypto.SHA256 prefix = "SHA-256=" default: - return fmt.Errorf("Unsupported signature scheme: %v", auth.SigningScheme) + return fmt.Errorf("unsupported signature scheme: %v", auth.SigningScheme) } if !h.Available() { - return fmt.Errorf("Hash '%v' is not available", h) + return fmt.Errorf("hash '%v' is not available", h) } // Build the "(request-target)" signature header. @@ -317,7 +317,7 @@ func SignRequest( m[h] = true } if len(m) != len(signedHeaders) { - return fmt.Errorf("List of signed headers must not have any duplicates") + return fmt.Errorf("list of signed headers must not have any duplicates") } hasCreatedParameter := false hasExpiresParameter := false @@ -326,7 +326,7 @@ func SignRequest( var value string switch header { case strings.ToLower(HttpHeaderAuthorization): - return fmt.Errorf("Cannot include the 'Authorization' header as a signed header.") + return fmt.Errorf("cannot include the 'Authorization' header as a signed header") case HttpSignatureParameterRequestTarget: value = requestTarget case HttpSignatureParameterCreated: @@ -334,7 +334,7 @@ func SignRequest( hasCreatedParameter = true case HttpSignatureParameterExpires: if auth.SignatureMaxValidity.Nanoseconds() == 0 { - return fmt.Errorf("Cannot set '(expires)' signature parameter. SignatureMaxValidity is not configured.") + return fmt.Errorf("cannot set '(expires)' signature parameter. SignatureMaxValidity is not configured") } value = fmt.Sprintf("%.3f", expiresUnix) hasExpiresParameter = true @@ -370,7 +370,7 @@ func SignRequest( if v, ok = r.Header[canonicalHeader]; !ok { // If a header specified in the headers parameter cannot be matched with // a provided header in the message, the implementation MUST produce an error. - return fmt.Errorf("Header '%s' does not exist in the request", canonicalHeader) + return fmt.Errorf("header '%s' does not exist in the request", canonicalHeader) } // If there are multiple instances of the same header field, all // header field values associated with the header field MUST be @@ -385,7 +385,7 @@ func SignRequest( fmt.Fprintf(&sb, "%s: %s", header, value) } if expiresUnix != 0 && !hasExpiresParameter { - return fmt.Errorf("SignatureMaxValidity is specified, but '(expired)' parameter is not present") + return fmt.Errorf("signatureMaxValidity is specified, but '(expired)' parameter is not present") } msg := []byte(sb.String()) msgHash := h.New() @@ -403,14 +403,14 @@ func SignRequest( case "", HttpSigningAlgorithmRsaPSS: signature, err = rsa.SignPSS(rand.Reader, key, h, d, nil) default: - return fmt.Errorf("Unsupported signing algorithm: '%s'", auth.SigningAlgorithm) + return fmt.Errorf("unsupported signing algorithm: '%s'", auth.SigningAlgorithm) } case *ecdsa.PrivateKey: signature, err = key.Sign(rand.Reader, d, h) case ed25519.PrivateKey: // requires go 1.13 signature, err = key.Sign(rand.Reader, msg, crypto.Hash(0)) default: - return fmt.Errorf("Unsupported private key") + return fmt.Errorf("unsupported private key") } if err != nil { return err diff --git a/samples/openapi3/client/petstore/go/go-petstore/utils.go b/samples/openapi3/client/petstore/go/go-petstore/utils.go index db7f0c4651d..866bbf7f1eb 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/utils.go +++ b/samples/openapi3/client/petstore/go/go-petstore/utils.go @@ -12,6 +12,7 @@ package petstore import ( "encoding/json" + "reflect" "time" ) @@ -326,3 +327,17 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + +// isNil checks if an input is nil +func isNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go.mod b/samples/openapi3/client/petstore/go/go.mod index 4496dcaf0bb..92b2d6ee6b8 100644 --- a/samples/openapi3/client/petstore/go/go.mod +++ b/samples/openapi3/client/petstore/go/go.mod @@ -7,6 +7,6 @@ replace go-petstore => ./go-petstore require ( github.com/stretchr/testify v1.8.0 go-petstore v0.0.0-00010101000000-000000000000 - golang.org/x/net v0.0.0-20221004154528-8021a29435af // indirect - golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1 + golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect + golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 ) diff --git a/samples/openapi3/client/petstore/go/go.sum b/samples/openapi3/client/petstore/go/go.sum index 63916a8bc45..3ddd48e10ff 100644 --- a/samples/openapi3/client/petstore/go/go.sum +++ b/samples/openapi3/client/petstore/go/go.sum @@ -305,6 +305,8 @@ golang.org/x/net v0.0.0-20220809184613-07c6da5e1ced h1:3dYNDff0VT5xj+mbj2XucFst9 golang.org/x/net v0.0.0-20220809184613-07c6da5e1ced/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221004154528-8021a29435af h1:wv66FM3rLZGPdxpYL+ApnDe2HzHcTFta3z5nsc13wI4= golang.org/x/net v0.0.0-20221004154528-8021a29435af/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -332,6 +334,8 @@ golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 h1:dtndE8FcEta75/4kHF3Abp golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1 h1:3VPzK7eqH25j7GYw5w6g/GzNRc0/fYtrxz27z1gD4W0= golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 h1:nt+Q6cXKz4MosCSpnbMtqiQ8Oz0pxTef2B4Vca2lvfk= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/samples/openapi3/client/petstore/go/http_signature_test.go b/samples/openapi3/client/petstore/go/http_signature_test.go index 104cd00f03e..492de97b525 100644 --- a/samples/openapi3/client/petstore/go/http_signature_test.go +++ b/samples/openapi3/client/petstore/go/http_signature_test.go @@ -650,7 +650,7 @@ func TestInvalidHttpSignatureConfiguration(t *testing.T) { authConfig = sw.HttpSignatureAuth{} _, err = authConfig.ContextWithValue(context.Background()) - if err == nil || !strings.Contains(err.Error(), "Key ID must be specified") { + if err == nil || !strings.Contains(err.Error(), "key ID must be specified") { t.Fatalf("Invalid configuration: %v", err) } @@ -658,7 +658,7 @@ func TestInvalidHttpSignatureConfiguration(t *testing.T) { KeyId: "my-key-id", } _, err = authConfig.ContextWithValue(context.Background()) - if err == nil || !strings.Contains(err.Error(), "Private key path must be specified") { + if err == nil || !strings.Contains(err.Error(), "private key path must be specified") { t.Fatalf("Invalid configuration: %v", err) } @@ -667,7 +667,7 @@ func TestInvalidHttpSignatureConfiguration(t *testing.T) { PrivateKeyPath: "test.pem", } _, err = authConfig.ContextWithValue(context.Background()) - if err == nil || !strings.Contains(err.Error(), "Invalid signing scheme") { + if err == nil || !strings.Contains(err.Error(), "invalid signing scheme") { t.Fatalf("Invalid configuration: %v", err) } @@ -677,7 +677,7 @@ func TestInvalidHttpSignatureConfiguration(t *testing.T) { SigningScheme: "garbage", } _, err = authConfig.ContextWithValue(context.Background()) - if err == nil || !strings.Contains(err.Error(), "Invalid signing scheme") { + if err == nil || !strings.Contains(err.Error(), "invalid signing scheme") { t.Fatalf("Invalid configuration: %v", err) } @@ -699,7 +699,7 @@ func TestInvalidHttpSignatureConfiguration(t *testing.T) { SignedHeaders: []string{"foo", "bar", "Authorization"}, } _, err = authConfig.ContextWithValue(context.Background()) - if err == nil || !strings.Contains(err.Error(), "Signed headers cannot include the 'Authorization' header") { + if err == nil || !strings.Contains(err.Error(), "signed headers cannot include the 'Authorization' header") { t.Fatalf("Invalid configuration: %v", err) } @@ -711,7 +711,7 @@ func TestInvalidHttpSignatureConfiguration(t *testing.T) { SignatureMaxValidity: -7 * time.Minute, } _, err = authConfig.ContextWithValue(context.Background()) - if err == nil || !strings.Contains(err.Error(), "Signature max validity must be a positive value") { + if err == nil || !strings.Contains(err.Error(), "signature max validity must be a positive value") { t.Fatalf("Invalid configuration: %v", err) } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle index 684a391a177..5aff9fba10c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle @@ -99,9 +99,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.2" - jackson_databind_version = "2.13.2.2" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "5.8.2" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt index 55c190edb38..336d35eaddc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt @@ -18,9 +18,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml index 21a045066b6..0b79d76a9f2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml @@ -335,9 +335,9 @@ UTF-8 1.6.5 2.35 - 2.13.2 - 2.13.2.2 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 5.8.2 2.21.0 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index 57a60f84dd7..0fe0594b3b5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -99,9 +99,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.2" - jackson_databind_version = "2.13.2.2" - jackson_databind_nullable_version = "0.2.3" + jackson_version = "2.13.4" + jackson_databind_version = "2.13.4.2" + jackson_databind_nullable_version = "0.2.4" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "5.8.2" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt index f3bcebc5f19..6aa48c594b2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt @@ -18,9 +18,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.1" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.3" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml index cb4f263b40f..537d456f2e2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml @@ -345,9 +345,9 @@ UTF-8 1.6.5 2.35 - 2.13.2 - 2.13.2.2 - 0.2.3 + 2.13.4 + 2.13.4.2 + 0.2.4 1.3.5 5.8.2 1.7 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 5e115bca68a..ac4d6528e7a 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 @@ -530,6 +530,22 @@ public class ApiClient extends JavaTimeFormatter { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link org.openapitools.client.ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + /** * Helper method to set the password flow for the first OAuth2 authentication. * diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java index ca5c1187edf..59edc528a44 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -42,7 +42,7 @@ public class ServerConfiguration { throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java index c55fb3793e2..69182323137 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java @@ -169,6 +169,19 @@ public class OAuth implements Authentication { return this; } + public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe().debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe() + .build(authApi); + } + return this; + } + public OAuth usePasswordFlow(String username, String password) { this.flow = OAuthFlow.PASSWORD; this.username = username; diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index f805094f7eb..24d52d4e13a 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -97,10 +97,12 @@ docs/models/NumberOnly.md docs/models/NumberWithValidations.md docs/models/ObjectInterface.md docs/models/ObjectModelWithRefProps.md +docs/models/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md docs/models/ObjectWithDecimalProperties.md docs/models/ObjectWithDifficultlyNamedProps.md docs/models/ObjectWithInlineCompositionProperty.md docs/models/ObjectWithInvalidNamedRefedProperties.md +docs/models/ObjectWithOptionalTestProp.md docs/models/ObjectWithValidations.md docs/models/Order.md docs/models/ParentPet.md @@ -318,6 +320,8 @@ petstore_api/model/object_interface.py petstore_api/model/object_interface.pyi petstore_api/model/object_model_with_ref_props.py petstore_api/model/object_model_with_ref_props.pyi +petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.py +petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.pyi petstore_api/model/object_with_decimal_properties.py petstore_api/model/object_with_decimal_properties.pyi petstore_api/model/object_with_difficultly_named_props.py @@ -326,6 +330,8 @@ petstore_api/model/object_with_inline_composition_property.py petstore_api/model/object_with_inline_composition_property.pyi petstore_api/model/object_with_invalid_named_refed_properties.py petstore_api/model/object_with_invalid_named_refed_properties.pyi +petstore_api/model/object_with_optional_test_prop.py +petstore_api/model/object_with_optional_test_prop.pyi petstore_api/model/object_with_validations.py petstore_api/model/object_with_validations.pyi petstore_api/model/order.py diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 7c9d0509b74..ca7562b37e7 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -319,10 +319,12 @@ Class | Method | HTTP request | Description - [NumberWithValidations](docs/models/NumberWithValidations.md) - [ObjectInterface](docs/models/ObjectInterface.md) - [ObjectModelWithRefProps](docs/models/ObjectModelWithRefProps.md) + - [ObjectWithAllOfWithReqTestPropFromUnsetAddProp](docs/models/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md) - [ObjectWithDecimalProperties](docs/models/ObjectWithDecimalProperties.md) - [ObjectWithDifficultlyNamedProps](docs/models/ObjectWithDifficultlyNamedProps.md) - [ObjectWithInlineCompositionProperty](docs/models/ObjectWithInlineCompositionProperty.md) - [ObjectWithInvalidNamedRefedProperties](docs/models/ObjectWithInvalidNamedRefedProperties.md) + - [ObjectWithOptionalTestProp](docs/models/ObjectWithOptionalTestProp.md) - [ObjectWithValidations](docs/models/ObjectWithValidations.md) - [Order](docs/models/Order.md) - [ParentPet](docs/models/ParentPet.md) diff --git a/samples/openapi3/client/petstore/python/docs/models/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md new file mode 100644 index 00000000000..6c4f1033e0e --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/models/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md @@ -0,0 +1,30 @@ +# petstore_api.model.object_with_all_of_with_req_test_prop_from_unset_add_prop.ObjectWithAllOfWithReqTestPropFromUnsetAddProp + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | + +### Composed Schemas (allOf/anyOf/oneOf/not) +#### allOf +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[ObjectWithOptionalTestProp](ObjectWithOptionalTestProp.md) | [**ObjectWithOptionalTestProp**](ObjectWithOptionalTestProp.md) | [**ObjectWithOptionalTestProp**](ObjectWithOptionalTestProp.md) | | +[all_of_1](#all_of_1) | dict, frozendict.frozendict, | frozendict.frozendict, | | + +# all_of_1 + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**test** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | | +**name** | str, | str, | | [optional] +**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [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/openapi3/client/petstore/python/docs/models/ObjectWithOptionalTestProp.md b/samples/openapi3/client/petstore/python/docs/models/ObjectWithOptionalTestProp.md new file mode 100644 index 00000000000..2f437c22d07 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/models/ObjectWithOptionalTestProp.md @@ -0,0 +1,15 @@ +# petstore_api.model.object_with_optional_test_prop.ObjectWithOptionalTestProp + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**test** | str, | str, | | [optional] +**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [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/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index d1b93ab5a68..9ee9ff13f68 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -297,7 +297,7 @@ class StyleFormSerializer(ParameterSerializerBase): prefix_separator_iterator: typing.Optional[PrefixSeparatorIterator] = None ) -> str: if prefix_separator_iterator is None: - prefix_separator_iterator = PrefixSeparatorIterator('?', '&') + prefix_separator_iterator = PrefixSeparatorIterator('', '&') return self._ref6570_expansion( variable_name=name, in_data=in_data, @@ -1471,7 +1471,7 @@ class RequestBody(StyleFormSerializer, JSONDetector): raise ValueError( f'Unable to serialize {in_data} to application/x-www-form-urlencoded because it is not a dict of data') cast_in_data = self.__json_encoder.default(in_data) - value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=False) + value = self._serialize_form(cast_in_data, name='', explode=True, percent_encode=True) return dict(body=value) def serialize( diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.py new file mode 100644 index 00000000000..beef11f6556 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithAllOfWithReqTestPropFromUnsetAddProp( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + required = { + "test", + } + + class properties: + name = schemas.StrSchema + __annotations__ = { + "name": name, + } + + test: schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + test: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + test=test, + name=name, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + ObjectWithOptionalTestProp, + cls.all_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ObjectWithAllOfWithReqTestPropFromUnsetAddProp': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.object_with_optional_test_prop import ObjectWithOptionalTestProp diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.pyi new file mode 100644 index 00000000000..beef11f6556 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_all_of_with_req_test_prop_from_unset_add_prop.pyi @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithAllOfWithReqTestPropFromUnsetAddProp( + schemas.ComposedSchema, +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + + class all_of_1( + schemas.DictSchema + ): + + + class MetaOapg: + required = { + "test", + } + + class properties: + name = schemas.StrSchema + __annotations__ = { + "name": name, + } + + test: schemas.AnyTypeSchema + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["name", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["name", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + test: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'all_of_1': + return super().__new__( + cls, + *args, + test=test, + name=name, + _configuration=_configuration, + **kwargs, + ) + + @classmethod + @functools.lru_cache() + def all_of(cls): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return [ + ObjectWithOptionalTestProp, + cls.all_of_1, + ] + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ObjectWithAllOfWithReqTestPropFromUnsetAddProp': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) + +from petstore_api.model.object_with_optional_test_prop import ObjectWithOptionalTestProp diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.py new file mode 100644 index 00000000000..07cae57d4c2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.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: https://openapi-generator.tech +""" + +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithOptionalTestProp( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + class properties: + test = schemas.StrSchema + __annotations__ = { + "test": test, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["test"]) -> MetaOapg.properties.test: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["test", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["test"]) -> typing.Union[MetaOapg.properties.test, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["test", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + test: typing.Union[MetaOapg.properties.test, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ObjectWithOptionalTestProp': + return super().__new__( + cls, + *args, + test=test, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.pyi b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.pyi new file mode 100644 index 00000000000..07cae57d4c2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_optional_test_prop.pyi @@ -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: https://openapi-generator.tech +""" + +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from petstore_api import schemas # noqa: F401 + + +class ObjectWithOptionalTestProp( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + + class properties: + test = schemas.StrSchema + __annotations__ = { + "test": test, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["test"]) -> MetaOapg.properties.test: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["test", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["test"]) -> typing.Union[MetaOapg.properties.test, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["test", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + test: typing.Union[MetaOapg.properties.test, str, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'ObjectWithOptionalTestProp': + return super().__new__( + cls, + *args, + test=test, + _configuration=_configuration, + **kwargs, + ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py index a3f42957f90..92305b81c13 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py @@ -99,10 +99,12 @@ from petstore_api.model.number_only import NumberOnly from petstore_api.model.number_with_validations import NumberWithValidations from petstore_api.model.object_interface import ObjectInterface from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.object_with_all_of_with_req_test_prop_from_unset_add_prop import ObjectWithAllOfWithReqTestPropFromUnsetAddProp from petstore_api.model.object_with_decimal_properties import ObjectWithDecimalProperties from petstore_api.model.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps from petstore_api.model.object_with_inline_composition_property import ObjectWithInlineCompositionProperty from petstore_api.model.object_with_invalid_named_refed_properties import ObjectWithInvalidNamedRefedProperties +from petstore_api.model.object_with_optional_test_prop import ObjectWithOptionalTestProp from petstore_api.model.object_with_validations import ObjectWithValidations from petstore_api.model.order import Order from petstore_api.model.parent_pet import ParentPet diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.py index 17e3ac65599..9803516eec2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.py @@ -148,6 +148,7 @@ class BaseApi(api_client.Api): @typing.overload def _group_parameters_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), header_params: RequestHeaderParams = frozendict.frozendict(), stream: bool = False, @@ -255,6 +256,7 @@ class GroupParameters(BaseApi): @typing.overload def group_parameters( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), header_params: RequestHeaderParams = frozendict.frozendict(), stream: bool = False, @@ -309,6 +311,7 @@ class ApiFordelete(BaseApi): @typing.overload def delete( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), header_params: RequestHeaderParams = frozendict.frozendict(), stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.pyi index c88235a2640..1bb21445f6f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete.pyi @@ -140,6 +140,7 @@ class BaseApi(api_client.Api): @typing.overload def _group_parameters_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), header_params: RequestHeaderParams = frozendict.frozendict(), stream: bool = False, @@ -247,6 +248,7 @@ class GroupParameters(BaseApi): @typing.overload def group_parameters( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), header_params: RequestHeaderParams = frozendict.frozendict(), stream: bool = False, @@ -301,6 +303,7 @@ class ApiFordelete(BaseApi): @typing.overload def delete( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), header_params: RequestHeaderParams = frozendict.frozendict(), stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.py index 971de7cf96c..766073175bf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.py @@ -103,6 +103,7 @@ class BaseApi(api_client.Api): @typing.overload def _case_sensitive_params_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -190,6 +191,7 @@ class CaseSensitiveParams(BaseApi): @typing.overload def case_sensitive_params( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -239,6 +241,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.pyi index 69c3adfb971..c5cab839898 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put.pyi @@ -98,6 +98,7 @@ class BaseApi(api_client.Api): @typing.overload def _case_sensitive_params_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -185,6 +186,7 @@ class CaseSensitiveParams(BaseApi): @typing.overload def case_sensitive_params( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -234,6 +236,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.py index 6aeab76eac6..4d74087f3bd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.py @@ -98,6 +98,7 @@ class BaseApi(api_client.Api): @typing.overload def _delete_coffee_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -190,6 +191,7 @@ class DeleteCoffee(BaseApi): @typing.overload def delete_coffee( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -241,6 +243,7 @@ class ApiFordelete(BaseApi): @typing.overload def delete( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.pyi index 7a0240795e9..a63211d2c05 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete.pyi @@ -92,6 +92,7 @@ class BaseApi(api_client.Api): @typing.overload def _delete_coffee_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -184,6 +185,7 @@ class DeleteCoffee(BaseApi): @typing.overload def delete_coffee( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -235,6 +237,7 @@ class ApiFordelete(BaseApi): @typing.overload def delete( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.py index f3ebfb0b65b..448891337f1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.py @@ -71,6 +71,7 @@ class BaseApi(api_client.Api): @typing.overload def _fake_health_get_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -149,6 +150,7 @@ class FakeHealthGet(BaseApi): @typing.overload def fake_health_get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -198,6 +200,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.pyi index f63161e2d2c..5782ac9c7e7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get.pyi @@ -66,6 +66,7 @@ class BaseApi(api_client.Api): @typing.overload def _fake_health_get_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -144,6 +145,7 @@ class FakeHealthGet(BaseApi): @typing.overload def fake_health_get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -193,6 +195,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.py index 60e361c9b36..035b7c3bd98 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.py @@ -133,6 +133,7 @@ class BaseApi(api_client.Api): @typing.overload def _object_in_query_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -219,6 +220,7 @@ class ObjectInQuery(BaseApi): @typing.overload def object_in_query( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -268,6 +270,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.pyi index f6bcadc02c7..ddfcbed6217 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get.pyi @@ -128,6 +128,7 @@ class BaseApi(api_client.Api): @typing.overload def _object_in_query_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -214,6 +215,7 @@ class ObjectInQuery(BaseApi): @typing.overload def object_in_query( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -263,6 +265,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.py index 6c26877167a..c829e40dd2d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.py @@ -97,6 +97,7 @@ class BaseApi(api_client.Api): @typing.overload def _query_param_with_json_content_type_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -193,6 +194,7 @@ class QueryParamWithJsonContentType(BaseApi): @typing.overload def query_param_with_json_content_type( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -247,6 +249,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.pyi index 9d042a631fe..ccf449dcfdd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get.pyi @@ -92,6 +92,7 @@ class BaseApi(api_client.Api): @typing.overload def _query_param_with_json_content_type_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -188,6 +189,7 @@ class QueryParamWithJsonContentType(BaseApi): @typing.overload def query_param_with_json_content_type( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -242,6 +244,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.py index adf88955860..6a5556eb380 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.py @@ -86,6 +86,7 @@ class BaseApi(api_client.Api): @typing.overload def _ref_object_in_query_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -172,6 +173,7 @@ class RefObjectInQuery(BaseApi): @typing.overload def ref_object_in_query( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -221,6 +223,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.pyi index 8c34a127490..70a37a3ac11 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get.pyi @@ -81,6 +81,7 @@ class BaseApi(api_client.Api): @typing.overload def _ref_object_in_query_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -167,6 +168,7 @@ class RefObjectInQuery(BaseApi): @typing.overload def ref_object_in_query( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -216,6 +218,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.py index f286d0d05aa..f62d1360ba0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.py @@ -70,6 +70,7 @@ class BaseApi(api_client.Api): @typing.overload def _response_without_schema_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -148,6 +149,7 @@ class ResponseWithoutSchema(BaseApi): @typing.overload def response_without_schema( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -197,6 +199,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.pyi index e562a50173d..ecb63bdc8e2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get.pyi @@ -65,6 +65,7 @@ class BaseApi(api_client.Api): @typing.overload def _response_without_schema_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -143,6 +144,7 @@ class ResponseWithoutSchema(BaseApi): @typing.overload def response_without_schema( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -192,6 +194,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.py index 760ceea2cef..1384c49ad15 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.py @@ -239,6 +239,7 @@ class BaseApi(api_client.Api): @typing.overload def _query_parameter_collection_format_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -329,6 +330,7 @@ class QueryParameterCollectionFormat(BaseApi): @typing.overload def query_parameter_collection_format( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -378,6 +380,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.pyi index 7923932d131..230c45c3ae1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put.pyi @@ -234,6 +234,7 @@ class BaseApi(api_client.Api): @typing.overload def _query_parameter_collection_format_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -324,6 +325,7 @@ class QueryParameterCollectionFormat(BaseApi): @typing.overload def query_parameter_collection_format( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -373,6 +375,7 @@ class ApiForput(BaseApi): @typing.overload def put( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.py index bde734e7581..e2d1fda9cf5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.py @@ -123,6 +123,7 @@ class BaseApi(api_client.Api): @typing.overload def _foo_get_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -204,6 +205,7 @@ class FooGet(BaseApi): @typing.overload def foo_get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -253,6 +255,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.pyi index 4c5f088f788..9cfee5e76d1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get.pyi @@ -118,6 +118,7 @@ class BaseApi(api_client.Api): @typing.overload def _foo_get_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -199,6 +200,7 @@ class FooGet(BaseApi): @typing.overload def foo_get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -248,6 +250,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.py index bca423ad68f..5b753a5bb5d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.py @@ -217,6 +217,7 @@ class BaseApi(api_client.Api): @typing.overload def _find_pets_by_status_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -314,6 +315,7 @@ class FindPetsByStatus(BaseApi): @typing.overload def find_pets_by_status( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -368,6 +370,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.pyi index e19a8036737..59b71f5fc19 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get.pyi @@ -199,6 +199,7 @@ class BaseApi(api_client.Api): @typing.overload def _find_pets_by_status_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -296,6 +297,7 @@ class FindPetsByStatus(BaseApi): @typing.overload def find_pets_by_status( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -350,6 +352,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.py index 982aeb15c29..4725d356cf4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.py @@ -192,6 +192,7 @@ class BaseApi(api_client.Api): @typing.overload def _find_pets_by_tags_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -289,6 +290,7 @@ class FindPetsByTags(BaseApi): @typing.overload def find_pets_by_tags( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -343,6 +345,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.pyi index c48153b2ffa..e512a26f01a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get.pyi @@ -182,6 +182,7 @@ class BaseApi(api_client.Api): @typing.overload def _find_pets_by_tags_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -279,6 +280,7 @@ class FindPetsByTags(BaseApi): @typing.overload def find_pets_by_tags( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -333,6 +335,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.py index ae048dfccc9..3651dff1d3b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.py @@ -111,6 +111,7 @@ class BaseApi(api_client.Api): @typing.overload def _delete_pet_oapg( self, + skip_deserialization: typing_extensions.Literal[True], header_params: RequestHeaderParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, @@ -210,6 +211,7 @@ class DeletePet(BaseApi): @typing.overload def delete_pet( self, + skip_deserialization: typing_extensions.Literal[True], header_params: RequestHeaderParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, @@ -260,6 +262,7 @@ class ApiFordelete(BaseApi): @typing.overload def delete( self, + skip_deserialization: typing_extensions.Literal[True], header_params: RequestHeaderParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.pyi index 2a56be3473c..eb9bc416c00 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete.pyi @@ -103,6 +103,7 @@ class BaseApi(api_client.Api): @typing.overload def _delete_pet_oapg( self, + skip_deserialization: typing_extensions.Literal[True], header_params: RequestHeaderParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, @@ -202,6 +203,7 @@ class DeletePet(BaseApi): @typing.overload def delete_pet( self, + skip_deserialization: typing_extensions.Literal[True], header_params: RequestHeaderParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, @@ -252,6 +254,7 @@ class ApiFordelete(BaseApi): @typing.overload def delete( self, + skip_deserialization: typing_extensions.Literal[True], header_params: RequestHeaderParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.py index b170ee44855..9dc1735114e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.py @@ -132,6 +132,7 @@ class BaseApi(api_client.Api): @typing.overload def _get_pet_by_id_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -229,6 +230,7 @@ class GetPetById(BaseApi): @typing.overload def get_pet_by_id( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -283,6 +285,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.pyi index 4ed83baee2b..5ae107f3242 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get.pyi @@ -122,6 +122,7 @@ class BaseApi(api_client.Api): @typing.overload def _get_pet_by_id_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -219,6 +220,7 @@ class GetPetById(BaseApi): @typing.overload def get_pet_by_id( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -273,6 +275,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.py index 4f9f0eb1f7a..56ed16e1cc8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.py @@ -100,6 +100,7 @@ class BaseApi(api_client.Api): @typing.overload def _get_inventory_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -179,6 +180,7 @@ class GetInventory(BaseApi): @typing.overload def get_inventory( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -228,6 +230,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.pyi index 30d769a9d31..b2eb524a8e2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get.pyi @@ -92,6 +92,7 @@ class BaseApi(api_client.Api): @typing.overload def _get_inventory_oapg( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -171,6 +172,7 @@ class GetInventory(BaseApi): @typing.overload def get_inventory( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -220,6 +222,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.py index 65f49c91e49..2e2edd945d7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.py @@ -94,6 +94,7 @@ class BaseApi(api_client.Api): @typing.overload def _delete_order_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -176,6 +177,7 @@ class DeleteOrder(BaseApi): @typing.overload def delete_order( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -221,6 +223,7 @@ class ApiFordelete(BaseApi): @typing.overload def delete( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.pyi index 74af6d4a61f..6eefe3953d1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete.pyi @@ -88,6 +88,7 @@ class BaseApi(api_client.Api): @typing.overload def _delete_order_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -170,6 +171,7 @@ class DeleteOrder(BaseApi): @typing.overload def delete_order( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -215,6 +217,7 @@ class ApiFordelete(BaseApi): @typing.overload def delete( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.py index 9c920df2a9d..8c52441cf1e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.py @@ -139,6 +139,7 @@ class BaseApi(api_client.Api): @typing.overload def _get_order_by_id_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -235,6 +236,7 @@ class GetOrderById(BaseApi): @typing.overload def get_order_by_id( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -289,6 +291,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.pyi index a421c4ab4a2..a4e2735912c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get.pyi @@ -127,6 +127,7 @@ class BaseApi(api_client.Api): @typing.overload def _get_order_by_id_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -223,6 +224,7 @@ class GetOrderById(BaseApi): @typing.overload def get_order_by_id( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -277,6 +279,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.py index acbe1ccb1d9..0d963a9eb28 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.py @@ -147,6 +147,7 @@ class BaseApi(api_client.Api): @typing.overload def _login_user_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -244,6 +245,7 @@ class LoginUser(BaseApi): @typing.overload def login_user( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -298,6 +300,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.pyi index 651fb8afc47..3fb920a0c0e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get.pyi @@ -131,6 +131,7 @@ class BaseApi(api_client.Api): @typing.overload def _login_user_oapg( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -228,6 +229,7 @@ class LoginUser(BaseApi): @typing.overload def login_user( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -282,6 +284,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.py index 085a4ba6750..0814ac97f9f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.py @@ -57,6 +57,7 @@ class BaseApi(api_client.Api): @typing.overload def _logout_user_oapg( self, + skip_deserialization: typing_extensions.Literal[True], stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -129,6 +130,7 @@ class LogoutUser(BaseApi): @typing.overload def logout_user( self, + skip_deserialization: typing_extensions.Literal[True], stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -173,6 +175,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.pyi index 52192b64068..302df64884f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get.pyi @@ -52,6 +52,7 @@ class BaseApi(api_client.Api): @typing.overload def _logout_user_oapg( self, + skip_deserialization: typing_extensions.Literal[True], stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -124,6 +125,7 @@ class LogoutUser(BaseApi): @typing.overload def logout_user( self, + skip_deserialization: typing_extensions.Literal[True], stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -168,6 +170,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.py index 1fbeabb7247..769252ca8da 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.py @@ -97,6 +97,7 @@ class BaseApi(api_client.Api): @typing.overload def _delete_user_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -183,6 +184,7 @@ class DeleteUser(BaseApi): @typing.overload def delete_user( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -232,6 +234,7 @@ class ApiFordelete(BaseApi): @typing.overload def delete( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.pyi index 3bc4ec391e8..3240953717f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete.pyi @@ -91,6 +91,7 @@ class BaseApi(api_client.Api): @typing.overload def _delete_user_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -177,6 +178,7 @@ class DeleteUser(BaseApi): @typing.overload def delete_user( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, @@ -226,6 +228,7 @@ class ApiFordelete(BaseApi): @typing.overload def delete( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.py index a75bc873e13..9ee437ce793 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.py @@ -129,6 +129,7 @@ class BaseApi(api_client.Api): @typing.overload def _get_user_by_name_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -225,6 +226,7 @@ class GetUserByName(BaseApi): @typing.overload def get_user_by_name( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -279,6 +281,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.pyi index 60b333602a3..63e188e6ce6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get.pyi @@ -122,6 +122,7 @@ class BaseApi(api_client.Api): @typing.overload def _get_user_by_name_oapg( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -218,6 +219,7 @@ class GetUserByName(BaseApi): @typing.overload def get_user_by_name( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -272,6 +274,7 @@ class ApiForget(BaseApi): @typing.overload def get( self, + skip_deserialization: typing_extensions.Literal[True], path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, diff --git a/samples/openapi3/client/petstore/python/petstore_api/rest.py b/samples/openapi3/client/petstore/python/petstore_api/rest.py index 40e35989f9a..53103c28ffe 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python/petstore_api/rest.py @@ -146,6 +146,7 @@ class RESTClientObject(object): elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 r = self.pool_manager.request( method, url, + body=body, fields=fields, encode_multipart=False, preload_content=not stream, diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py new file mode 100644 index 00000000000..7f9078b4d72 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import petstore_api +from petstore_api.model.object_with_all_of_with_req_test_prop_from_unset_add_prop import ObjectWithAllOfWithReqTestPropFromUnsetAddProp +from petstore_api import configuration + + +class TestObjectWithAllOfWithReqTestPropFromUnsetAddProp(unittest.TestCase): + """ObjectWithAllOfWithReqTestPropFromUnsetAddProp unit test stubs""" + _configuration = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_models/test_object_with_optional_test_prop.py b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_optional_test_prop.py new file mode 100644 index 00000000000..fbd21e71b9f --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_models/test_object_with_optional_test_prop.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import petstore_api +from petstore_api.model.object_with_optional_test_prop import ObjectWithOptionalTestProp +from petstore_api import configuration + + +class TestObjectWithOptionalTestProp(unittest.TestCase): + """ObjectWithOptionalTestProp unit test stubs""" + _configuration = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py index 7ce4a60e8f7..5bf64cee445 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py @@ -35,7 +35,8 @@ class MIMEFormdata(nonmultipart.MIMENonMultipart): class TestFakeApi(ApiTestMixin): """FakeApi unit test stubs""" configuration = petstore_api.Configuration() - api = FakeApi(api_client=api_client.ApiClient(configuration=configuration)) + api_client = api_client.ApiClient(configuration=configuration) + api = FakeApi(api_client=api_client) def test_array_model(self): from petstore_api.model import animal_farm, animal @@ -763,6 +764,32 @@ class TestFakeApi(ApiTestMixin): assert isinstance(api_response.body, schemas.Unset) assert isinstance(api_response.headers, schemas.Unset) + def test_x_www_form_urlencoded(self): + with patch.object(urllib3.PoolManager, 'request') as mock_request: + from urllib3._collections import HTTPHeaderDict + from petstore_api.apis.tags import pet_api + + pet_id = dict(petId=2345) + pet_values = dict( + name='mister furball award', + status='happy, fuzzy, and bouncy' + ) + mock_request.return_value = self.response("") + + api_instance = pet_api.PetApi(self.api_client) + api_instance.update_pet_with_form(path_params=pet_id, body=pet_values) + mock_request.assert_called_with( + 'POST', + 'http://petstore.swagger.io:80/v2/pet/2345', + body='name=mister%20furball%20award&status=happy%2C%20fuzzy%2C%20and%20bouncy', + fields={}, + encode_multipart=False, + preload_content=True, + timeout=None, + headers=HTTPHeaderDict({'User-Agent': self.user_agent, + 'Content-Type': 'application/x-www-form-urlencoded'}) + ) + def test_json_patch(self): with patch.object(urllib3.PoolManager, 'request') as mock_request: from petstore_api.model import json_patch_request diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py new file mode 100644 index 00000000000..5146c241eb6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import petstore_api +from petstore_api.model.object_with_all_of_with_req_test_prop_from_unset_add_prop import ObjectWithAllOfWithReqTestPropFromUnsetAddProp +from petstore_api import configuration + + +class TestObjectWithAllOfWithReqTestPropFromUnsetAddProp(unittest.TestCase): + """ObjectWithAllOfWithReqTestPropFromUnsetAddProp unit test stubs""" + + def test_model_instantiation(self): + inst = ObjectWithAllOfWithReqTestPropFromUnsetAddProp( + test='a' + ) + assert inst == {'test': 'a'} + + # without the required test property an execption is thrown + with self.assertRaises(petstore_api.exceptions.ApiTypeError): + ObjectWithAllOfWithReqTestPropFromUnsetAddProp( + name='a' + ) + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py b/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py index cbfb167754e..c1f78880e96 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_request_body.py @@ -110,7 +110,7 @@ class TestParameter(unittest.TestCase): def test_application_x_www_form_urlencoded_serialization(self): payload = dict( some_null=None, - some_str='a', + some_str='hi, spacether!', some_int=1, some_float=3.14, some_list=[], @@ -123,7 +123,7 @@ class TestParameter(unittest.TestCase): serialization = request_body.serialize(payload, content_type) self.assertEqual( serialization, - dict(body='?some_str=a&some_int=1&some_float=3.14') + dict(body='some_str=hi%2C%20spacether%21&some_int=1&some_float=3.14') ) serialization = request_body.serialize({}, content_type) diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java index 6df9dd11eea..0b132252a8c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java @@ -33,7 +33,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { /** diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java index 4d454fbca0f..5e41c533732 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java @@ -33,7 +33,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { /** diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java index f9b68b0370f..5aa08f0954b 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java @@ -34,7 +34,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "User", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { /** diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index 3c47bec0e58..ee84e42d4c2 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Default", description = "the Default API") -@RequestMapping("${openapi.apiDocumentation.base-path:}") public interface DefaultApi { /** 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 366a9b16df4..47e3335edee 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 @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "AnotherFake", description = "the AnotherFake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { /** 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 02927a5c037..3cee3811ffb 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 @@ -41,7 +41,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Fake", description = "the Fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { /** 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 eb063c99ff2..d41f06b6c2a 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 @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "FakeClassnameTags123", description = "the FakeClassnameTags123 API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTags123Api { /** 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 a25849f3fc7..d63709b82b0 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 @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { /** 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 b41330c4369..4aa4a703929 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 @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { /** 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 3481b5deed0..27e4a066053 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 @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "User", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { /** diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 8255978cbc2..649a08904c1 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { /** diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 04b9fa799ff..c7ad76d6991 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "Store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { /** diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index c5568c10a29..2c045526213 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "User", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { /** 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 0ebbaf00919..c74ca0c0a50 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 @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { /** 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 7a31445645d..b58dbd9bafc 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 @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { /** 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 5f190d8aaa6..aecc9b4b1ab 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 @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { /** 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 b4258a4297d..67c4a8d4dcd 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 @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { 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 aaca2f399a5..765941e6ab2 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 @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { 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 48aa42184e2..274d3b37f34 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 @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java index 453e7dee612..db8023afc88 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "bar", description = "the bar API") -@RequestMapping("${openapi.byRefOrValue.base-path:}") public interface BarApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApiController.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApiController.java index 4ff7051020f..7d23950718d 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApiController.java @@ -29,6 +29,7 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller +@RequestMapping("${openapi.byRefOrValue.base-path:}") public class BarApiController implements BarApi { private final NativeWebRequest request; diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java index c5f7ba6eeff..3a8c99e15ab 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "foo", description = "the foo API") -@RequestMapping("${openapi.byRefOrValue.base-path:}") public interface FooApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApiController.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApiController.java index c5a099e7aed..ea240bf97a9 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApiController.java @@ -29,6 +29,7 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Controller +@RequestMapping("${openapi.byRefOrValue.base-path:}") public class FooApiController implements FooApi { private final NativeWebRequest request; diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java index 0f7ff0628f2..469a5e322ef 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java index 7713fe93c41..b8fa3720a21 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApiController.java @@ -29,6 +29,7 @@ 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; diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java index 6dec1f26bb1..6d2330a325a 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java index 5b734a75ab6..a82dfc1734e 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java index e58db1bb2ec..f1f70a9f8bf 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java @@ -33,7 +33,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApiController.java index d12543b50f4..11972950264 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApiController.java @@ -29,6 +29,7 @@ import jakarta.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; diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java index 19f9654f76c..d0eed779fd0 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java @@ -33,7 +33,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApiController.java index da7fe83d448..eaca23c3f81 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ import jakarta.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; diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java index 859d4a2adb8..d44b39e1354 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java @@ -34,7 +34,6 @@ import jakarta.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApiController.java index a2e3c11d32f..412a400d7d0 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ import jakarta.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; 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 index cf9ab80cce1..5d716a83385 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES @@ -15,6 +15,7 @@ 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 diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index e5ae1fe0f7c..fba11ac08bb 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { 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 index 65c9de6908c..c2db7ca5a81 100644 --- 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 @@ -28,6 +28,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 108d5613a62..8dcbbff9a02 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -42,7 +42,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { 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 index b30f53bb595..5ae5d5fed98 100644 --- 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 @@ -38,6 +38,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4d790f60b4e..8d87477c2b1 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { 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 index 05196793d4c..65b695629d4 100644 --- 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 @@ -28,6 +28,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 35204378870..3542fcccb55 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { 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 index 0b88e5980bf..ea6c56e02c1 100644 --- 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 @@ -30,6 +30,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 9701656fdea..836aa2500f7 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { 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 index f8c784ff383..1292dc0b721 100644 --- 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 @@ -29,6 +29,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 1f877cc25ea..09484728d82 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { 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 index 894bf6db762..ca00184d2a5 100644 --- 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 @@ -30,6 +30,7 @@ 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; 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 new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + 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/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml index 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES index 813eb7c338f..3299b46a7b2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -21,6 +21,7 @@ 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/configuration/SpringDocConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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 0ad08ed991a..122955b07be 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 @@ -28,7 +28,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default AnotherFakeApiDelegate getDelegate() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7c3f2049247..e27e2fc20ea 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -27,6 +27,7 @@ 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; 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 9191b1e9ad5..21888ab0e8d 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 @@ -38,7 +38,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default FakeApiDelegate getDelegate() { 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 8e624ba5fb5..726b17779f1 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 @@ -37,6 +37,7 @@ 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; 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 12105b4b41e..a42bc82021d 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 @@ -28,7 +28,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default FakeClassnameTestApiDelegate getDelegate() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 48a276daf13..21e28fe8b21 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -27,6 +27,7 @@ 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; 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 96bb8950479..8ef3dca5c9c 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 @@ -30,7 +30,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default PetApiDelegate getDelegate() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index e27c4c3b49d..5ef3de965ff 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -29,6 +29,7 @@ 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 PetApiDelegate delegate; 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 10bf51aac2a..a54fc47aec0 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 @@ -29,7 +29,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default StoreApiDelegate getDelegate() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java index 8c3b33a99af..e9e29a41b4f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java @@ -28,6 +28,7 @@ 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 StoreApiDelegate delegate; 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 3d9282e734c..46f91175427 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 @@ -30,7 +30,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default UserApiDelegate getDelegate() { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java index 58511a07291..1b48d4a9444 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java @@ -29,6 +29,7 @@ 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 UserApiDelegate delegate; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 5fdcfc33ead..2999e6f2f8d 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 @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index cf9ab80cce1..5d716a83385 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -15,6 +15,7 @@ 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 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 e5ae1fe0f7c..fba11ac08bb 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 @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 65c9de6908c..c2db7ca5a81 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -28,6 +28,7 @@ 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; 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 842745ade49..b408fc5c062 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 @@ -42,7 +42,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { 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 b30f53bb595..5ae5d5fed98 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 @@ -38,6 +38,7 @@ 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; 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 4d790f60b4e..8d87477c2b1 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 @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 05196793d4c..65b695629d4 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -28,6 +28,7 @@ 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; 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 0bb041aa47a..7fa1f66a018 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 @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java index 0b88e5980bf..ea6c56e02c1 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java @@ -30,6 +30,7 @@ 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; 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 9701656fdea..836aa2500f7 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 @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; 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 1f877cc25ea..09484728d82 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 @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 5fdcfc33ead..2999e6f2f8d 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 @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES index 0ed351e7bda..1fc07e54e68 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES @@ -21,6 +21,7 @@ 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 diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index e71e6c001ef..66d3dc15099 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default AnotherFakeApiDelegate getDelegate() { 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 index 7c3f2049247..e27e2fc20ea 100644 --- 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 @@ -27,6 +27,7 @@ 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; 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 index 575a4e23910..55b8ba0da1d 100644 --- 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 @@ -46,7 +46,7 @@ public interface AnotherFakeApiDelegate { break; } } - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index c93fe2392a4..1a9631a15ad 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -42,7 +42,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default FakeApiDelegate getDelegate() { 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 index 8e624ba5fb5..726b17779f1 100644 --- 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 @@ -37,6 +37,7 @@ 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; 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 index 8a91326998a..611aad3212a 100644 --- 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 @@ -49,7 +49,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(xmlItem).then(Mono.empty()); } @@ -65,7 +65,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -88,7 +88,7 @@ public interface FakeApiDelegate { break; } } - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -104,7 +104,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -120,7 +120,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -136,7 +136,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -153,7 +153,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -176,7 +176,7 @@ public interface FakeApiDelegate { break; } } - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -291,7 +291,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(param).then(Mono.empty()); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c3bb4078c72..2baae42af1b 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default FakeClassnameTestApiDelegate getDelegate() { 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 index 48a276daf13..21e28fe8b21 100644 --- 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 @@ -27,6 +27,7 @@ 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; 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 index bd1f7f3542f..0c2f87127f9 100644 --- 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 @@ -46,7 +46,7 @@ public interface FakeClassnameTestApiDelegate { break; } } - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 6ad75ecb6ba..e5bb02ffaff 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default PetApiDelegate getDelegate() { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java index e27c4c3b49d..5ef3de965ff 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java @@ -29,6 +29,7 @@ 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 PetApiDelegate delegate; 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 index 23e86e8d558..dca0f87bf72 100644 --- 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 @@ -41,7 +41,7 @@ public interface PetApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -167,7 +167,7 @@ public interface PetApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 4bbeb213205..3e9c0e7217e 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default StoreApiDelegate getDelegate() { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java index 8c3b33a99af..e9e29a41b4f 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java @@ -28,6 +28,7 @@ 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 StoreApiDelegate delegate; 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 index d4f1e2efbf9..cc442cd3ae4 100644 --- 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 @@ -113,7 +113,7 @@ public interface StoreApiDelegate { break; } } - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 1b50d6964c8..fb9f62f466f 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default UserApiDelegate getDelegate() { diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java index 58511a07291..1b48d4a9444 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java @@ -29,6 +29,7 @@ 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 UserApiDelegate delegate; 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 index 063cd6d0ee8..8a589951350 100644 --- 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 @@ -41,7 +41,7 @@ public interface UserApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -56,7 +56,7 @@ public interface UserApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.thenMany(body).then(Mono.empty()); } @@ -71,7 +71,7 @@ public interface UserApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.thenMany(body).then(Mono.empty()); } @@ -167,7 +167,7 @@ public interface UserApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + 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 new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + 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/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java index 194fe8b0b2e..fd146f2bc8f 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java index 7713fe93c41..b8fa3720a21 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java @@ -29,6 +29,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java index c5429143617..3044b699b0d 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java index 37da2fb80a0..66fab2a5f57 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES index cf9ab80cce1..5d716a83385 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES @@ -15,6 +15,7 @@ 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 diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index e5ae1fe0f7c..fba11ac08bb 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { 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 index 65c9de6908c..c2db7ca5a81 100644 --- 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 @@ -28,6 +28,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index fff427ac110..fcfa5b29f40 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -42,7 +42,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { 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 index b30f53bb595..5ae5d5fed98 100644 --- 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 @@ -38,6 +38,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4d790f60b4e..8d87477c2b1 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { 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 index 05196793d4c..65b695629d4 100644 --- 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 @@ -28,6 +28,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 00fdc569dac..76555655672 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { 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 index 0b88e5980bf..ea6c56e02c1 100644 --- 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 @@ -30,6 +30,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 9701656fdea..836aa2500f7 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { 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 index f8c784ff383..1292dc0b721 100644 --- 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 @@ -29,6 +29,7 @@ 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; diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 1f877cc25ea..09484728d82 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { 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 index 894bf6db762..ca00184d2a5 100644 --- 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 @@ -30,6 +30,7 @@ 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; 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 new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + 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/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml index 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json index 323c86f1829..81d9cb2a73d 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/wwwroot/openapi-original.json @@ -979,7 +979,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -992,7 +993,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/go-echo-server/go.mod b/samples/server/petstore/go-echo-server/go.mod index a7d3a57f619..586002dcc6c 100644 --- a/samples/server/petstore/go-echo-server/go.mod +++ b/samples/server/petstore/go-echo-server/go.mod @@ -2,4 +2,4 @@ module github.com/GIT_USER_ID/GIT_REPO_ID go 1.16 -require github.com/labstack/echo/v4 v4.2.0 +require github.com/labstack/echo/v4 v4.9.0 diff --git a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json index 8c3a37f8895..e5d8a0e3b07 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json +++ b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json @@ -1008,7 +1008,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -1021,7 +1022,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-async/public/openapi.json b/samples/server/petstore/java-play-framework-async/public/openapi.json index 8c3a37f8895..e5d8a0e3b07 100644 --- a/samples/server/petstore/java-play-framework-async/public/openapi.json +++ b/samples/server/petstore/java-play-framework-async/public/openapi.json @@ -1008,7 +1008,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -1021,7 +1022,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json index 8c3a37f8895..e5d8a0e3b07 100644 --- a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json +++ b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json @@ -1008,7 +1008,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -1021,7 +1022,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json index 3178371fbb2..2e2d45c7b32 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json @@ -2699,7 +2699,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -2712,7 +2713,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" }, "testEnumParameters_request" : { "properties" : { @@ -2731,7 +2733,8 @@ "enum" : [ "_abc", "-efg", "(xyz)" ], "type" : "string" } - } + }, + "type" : "object" }, "testEndpointParameters_request" : { "properties" : { @@ -2815,7 +2818,8 @@ "type" : "string" } }, - "required" : [ "byte", "double", "number", "pattern_without_delimiter" ] + "required" : [ "byte", "double", "number", "pattern_without_delimiter" ], + "type" : "object" }, "testJsonFormData_request" : { "properties" : { @@ -2828,7 +2832,8 @@ "type" : "string" } }, - "required" : [ "param", "param2" ] + "required" : [ "param", "param2" ], + "type" : "object" }, "uploadFileWithRequiredFile_request" : { "properties" : { @@ -2842,7 +2847,8 @@ "type" : "string" } }, - "required" : [ "requiredFile" ] + "required" : [ "requiredFile" ], + "type" : "object" }, "Dog_allOf" : { "properties" : { diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json index 8c3a37f8895..e5d8a0e3b07 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json @@ -1008,7 +1008,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -1021,7 +1022,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json index 8c3a37f8895..e5d8a0e3b07 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json @@ -1008,7 +1008,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -1021,7 +1022,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json index 8c3a37f8895..e5d8a0e3b07 100644 --- a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json @@ -1008,7 +1008,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -1021,7 +1022,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-no-nullable/public/openapi.json b/samples/server/petstore/java-play-framework-no-nullable/public/openapi.json index 8c3a37f8895..e5d8a0e3b07 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-nullable/public/openapi.json @@ -1008,7 +1008,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -1021,7 +1022,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json index 8c3a37f8895..e5d8a0e3b07 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json @@ -1008,7 +1008,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -1021,7 +1022,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-play-framework/public/openapi.json b/samples/server/petstore/java-play-framework/public/openapi.json index 8c3a37f8895..e5d8a0e3b07 100644 --- a/samples/server/petstore/java-play-framework/public/openapi.json +++ b/samples/server/petstore/java-play-framework/public/openapi.json @@ -1008,7 +1008,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -1021,7 +1022,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json b/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json index 8c3a37f8895..e5d8a0e3b07 100644 --- a/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json +++ b/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json @@ -1008,7 +1008,8 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" }, "uploadFile_request" : { "properties" : { @@ -1021,7 +1022,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java index ab81f566027..1eb07dfd313 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.AnotherFakeApiService; import org.openapitools.api.factories.AnotherFakeApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApiService.java index 2dc873d3a75..2ed812ff4cf 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java index 9493b5ecc77..3f87596c76f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.FakeApiService; import org.openapitools.api.factories.FakeApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java index a3ab5e2e151..3cc65be92b9 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 041ecec5af2..71983cd491c 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.FakeClassnameTestApiService; import org.openapitools.api.factories.FakeClassnameTestApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java index b5890e14dc4..9b9724797df 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java index a0705de623e..8719845cca7 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.PetApiService; import org.openapitools.api.factories.PetApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java index 2d9abcfd046..5a082c27fd4 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java index e2dc4506090..92d0a9cda85 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.StoreApiService; import org.openapitools.api.factories.StoreApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApiService.java index 6cc42048700..679dae579bf 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java index cbf11d458a5..3373ef79385 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.UserApiService; import org.openapitools.api.factories.UserApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java index 0398450b90e..6b3d986c8b4 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index cb1a8cd7e00..1908572ea2c 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import org.openapitools.model.Client; import java.util.List; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 40cfa39e705..a0e15051506 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.math.BigDecimal; import org.openapitools.model.Client; import java.io.File; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java index 35349641b7a..6f681177cb1 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import org.openapitools.model.Client; import java.util.List; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 5cbdde95355..628d5183e76 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 51a7d07d47b..b4ec457464f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.util.Map; import org.openapitools.model.Order; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 2777fd418e3..cf0b4bd1876 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.util.List; import java.time.OffsetDateTime; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 9d313e3f523..30ceb45c584 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.AnotherFakeApiService; import org.openapitools.api.factories.AnotherFakeApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApiService.java index 1b0692e8bb3..ac73af977cf 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index 8d44fa17173..8bc0907117a 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.FakeApiService; import org.openapitools.api.factories.FakeApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java index b264292a22a..46be025f281 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 70860ff047c..3dcb6116ed4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.FakeClassnameTestApiService; import org.openapitools.api.factories.FakeClassnameTestApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java index 139bc662787..cb5c11254d4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java index 20c04683dfa..e1e2ff8ea01 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.FooApiService; import org.openapitools.api.factories.FooApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApiService.java index 07f7f34dcef..dc51a2311da 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java index 75e0bf5a550..fa81260c526 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.PetApiService; import org.openapitools.api.factories.PetApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApiService.java index 3c81ecd0b21..c62ed050998 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java index 77d316cfab1..6f9333a9b05 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.StoreApiService; import org.openapitools.api.factories.StoreApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApiService.java index ac681a28f25..371e9de5d7b 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java index 9ef9cce8fa0..0f3825ebbfe 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.UserApiService; import org.openapitools.api.factories.UserApiServiceFactory; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java index a97a94b9630..f37ae6c52c1 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index fdee4655636..840de7f0c32 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import org.openapitools.model.Client; import java.util.List; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 35bba32738c..543ff24f31e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.math.BigDecimal; import org.openapitools.model.Client; import java.util.Date; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java index 7fd09a048e1..8dae1b59a76 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import org.openapitools.model.Client; import java.util.List; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FooApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FooApiServiceImpl.java index c83f4b9d1da..344f74d8e83 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FooApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FooApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import org.openapitools.model.FooGetDefaultResponse; import java.util.List; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 7c7baf7a7ec..f7e82817f39 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 6fdfb60073a..536e5779d00 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.util.Map; import org.openapitools.model.Order; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index f52f29ff610..e4e26b6e054 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java index d66efe4df88..fb96b911047 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.AnotherFakeApiService; import org.openapitools.api.factories.AnotherFakeApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java index 2dc873d3a75..2ed812ff4cf 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java index 6b2c8133b98..f76bb76e05d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.FakeApiService; import org.openapitools.api.factories.FakeApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java index b74ceeb26a3..119c6a70f68 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java index d208f750ed6..df4e8f8e53e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.FakeClassnameTags123ApiService; import org.openapitools.api.factories.FakeClassnameTags123ApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123ApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123ApiService.java index 224bd192b52..e0d896f73c8 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123ApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123ApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java index 4a091331cc9..76bfef6c35f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.PetApiService; import org.openapitools.api.factories.PetApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java index e52293ebdd1..d4b7f595e62 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java index 7e7544d793f..c2080453606 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.StoreApiService; import org.openapitools.api.factories.StoreApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApiService.java index 6cc42048700..679dae579bf 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java index 4d1d6526e48..ea19c4c1ffd 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.UserApiService; import org.openapitools.api.factories.UserApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java index 493a47591e5..cef6058d296 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index cb1a8cd7e00..1908572ea2c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import org.openapitools.model.Client; import java.util.List; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index a948630d224..aa26da980b8 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.math.BigDecimal; import org.openapitools.model.Client; import java.util.Date; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java index 4e066abcbee..27c7eb541a7 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import org.openapitools.model.Client; import java.util.List; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index c7bec398d95..e2f96dc0f94 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 51a7d07d47b..b4ec457464f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.util.Map; import org.openapitools.model.Order; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index f4bd2bfef42..6075df2edee 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java index ab81f566027..1eb07dfd313 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.AnotherFakeApiService; import org.openapitools.api.factories.AnotherFakeApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApiService.java index 2dc873d3a75..2ed812ff4cf 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java index 6f1e2384acd..59ee63b1883 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.FakeApiService; import org.openapitools.api.factories.FakeApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java index 145a097c86c..c46e98aebc4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 041ecec5af2..71983cd491c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.FakeClassnameTestApiService; import org.openapitools.api.factories.FakeClassnameTestApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java index b5890e14dc4..9b9724797df 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java index a0705de623e..8719845cca7 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.PetApiService; import org.openapitools.api.factories.PetApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java index 2d9abcfd046..5a082c27fd4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java index e2dc4506090..92d0a9cda85 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.StoreApiService; import org.openapitools.api.factories.StoreApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApiService.java index 6cc42048700..679dae579bf 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java index a6293f6982c..afb57f5e259 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import org.openapitools.model.*; import org.openapitools.api.UserApiService; import org.openapitools.api.factories.UserApiServiceFactory; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java index 493a47591e5..cef6058d296 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.api.*; -import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index cb1a8cd7e00..1908572ea2c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import org.openapitools.model.Client; import java.util.List; diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 1a05630abc4..c73b41f7422 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.math.BigDecimal; import org.openapitools.model.Client; import java.util.Date; diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java index 35349641b7a..6f681177cb1 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import org.openapitools.model.Client; import java.util.List; diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 5cbdde95355..628d5183e76 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 51a7d07d47b..b4ec457464f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.util.Map; import org.openapitools.model.Order; diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index f4bd2bfef42..6075df2edee 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -1,8 +1,6 @@ package org.openapitools.api.impl; import org.openapitools.api.*; -import org.openapitools.model.*; - import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/resources/openapi.yaml index cd8953c54d0..f3e1fb465fe 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/resources/openapi.yaml @@ -742,6 +742,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -751,6 +752,7 @@ components: description: file to upload format: binary type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-reactive/src/main/resources/openapi.yaml index cd8953c54d0..f3e1fb465fe 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/resources/openapi.yaml @@ -742,6 +742,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -751,6 +752,7 @@ components: description: file to upload format: binary type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/resources/openapi.yaml index cd8953c54d0..f3e1fb465fe 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/resources/openapi.yaml @@ -742,6 +742,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -751,6 +752,7 @@ components: description: file to upload format: binary type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/resources/openapi.yaml index cd8953c54d0..f3e1fb465fe 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/resources/openapi.yaml @@ -742,6 +742,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -751,6 +752,7 @@ components: description: file to upload format: binary type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-springboot-springfox/src/main/resources/openapi.yaml index cd8953c54d0..f3e1fb465fe 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/resources/openapi.yaml @@ -742,6 +742,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -751,6 +752,7 @@ components: description: file to upload format: binary type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml index 4b0bc4d300f..b7d45bc5755 100644 --- a/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml @@ -799,6 +799,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -808,6 +809,7 @@ components: description: file to upload format: binary type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml index 4b0bc4d300f..b7d45bc5755 100644 --- a/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml @@ -799,6 +799,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -808,6 +809,7 @@ components: description: file to upload format: binary type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/python-flask/openapi_server/models/api_response.py b/samples/server/petstore/python-flask/openapi_server/models/api_response.py index b520253a9b4..1e23da9c230 100644 --- a/samples/server/petstore/python-flask/openapi_server/models/api_response.py +++ b/samples/server/petstore/python-flask/openapi_server/models/api_response.py @@ -37,9 +37,9 @@ class ApiResponse(Model): 'message': 'message' } - self.code = code - self.type = type - self.message = message + self._code = code + self._type = type + self._message = message @classmethod def from_dict(cls, dikt) -> 'ApiResponse': diff --git a/samples/server/petstore/python-flask/openapi_server/models/category.py b/samples/server/petstore/python-flask/openapi_server/models/category.py index 9ae904785be..3a68d86c250 100644 --- a/samples/server/petstore/python-flask/openapi_server/models/category.py +++ b/samples/server/petstore/python-flask/openapi_server/models/category.py @@ -33,8 +33,8 @@ class Category(Model): 'name': 'name' } - self.id = id - self.name = name + self._id = id + self._name = name @classmethod def from_dict(cls, dikt) -> 'Category': diff --git a/samples/server/petstore/python-flask/openapi_server/models/order.py b/samples/server/petstore/python-flask/openapi_server/models/order.py index 23f061c8217..aa8a7a71c39 100644 --- a/samples/server/petstore/python-flask/openapi_server/models/order.py +++ b/samples/server/petstore/python-flask/openapi_server/models/order.py @@ -49,12 +49,12 @@ class Order(Model): 'complete': 'complete' } - self.id = id - self.pet_id = pet_id - self.quantity = quantity - self.ship_date = ship_date - self.status = status - self.complete = complete + self._id = id + self._pet_id = pet_id + self._quantity = quantity + self._ship_date = ship_date + self._status = status + self._complete = complete @classmethod def from_dict(cls, dikt) -> 'Order': diff --git a/samples/server/petstore/python-flask/openapi_server/models/pet.py b/samples/server/petstore/python-flask/openapi_server/models/pet.py index 377c8accdfe..e61674165e1 100644 --- a/samples/server/petstore/python-flask/openapi_server/models/pet.py +++ b/samples/server/petstore/python-flask/openapi_server/models/pet.py @@ -53,12 +53,12 @@ class Pet(Model): 'status': 'status' } - self.id = id - self.category = category - self.name = name - self.photo_urls = photo_urls - self.tags = tags - self.status = status + self._id = id + self._category = category + self._name = name + self._photo_urls = photo_urls + self._tags = tags + self._status = status @classmethod def from_dict(cls, dikt) -> 'Pet': diff --git a/samples/server/petstore/python-flask/openapi_server/models/tag.py b/samples/server/petstore/python-flask/openapi_server/models/tag.py index deb88936e51..bd6fff16907 100644 --- a/samples/server/petstore/python-flask/openapi_server/models/tag.py +++ b/samples/server/petstore/python-flask/openapi_server/models/tag.py @@ -33,8 +33,8 @@ class Tag(Model): 'name': 'name' } - self.id = id - self.name = name + self._id = id + self._name = name @classmethod def from_dict(cls, dikt) -> 'Tag': diff --git a/samples/server/petstore/python-flask/openapi_server/models/user.py b/samples/server/petstore/python-flask/openapi_server/models/user.py index fdc250d5f01..1b1f4bdae72 100644 --- a/samples/server/petstore/python-flask/openapi_server/models/user.py +++ b/samples/server/petstore/python-flask/openapi_server/models/user.py @@ -57,14 +57,14 @@ class User(Model): 'user_status': 'userStatus' } - self.id = id - self.username = username - self.first_name = first_name - self.last_name = last_name - self.email = email - self.password = password - self.phone = phone - self.user_status = user_status + self._id = id + self._username = username + self._first_name = first_name + self._last_name = last_name + self._email = email + self._password = password + self._phone = phone + self._user_status = user_status @classmethod def from_dict(cls, dikt) -> 'User': diff --git a/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml index 88f24d6be5c..ff528ad1f41 100644 --- a/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml @@ -788,6 +788,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -797,6 +798,7 @@ components: description: file to upload format: binary type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml b/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml index 22eca2e721b..02def281f90 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "multipart-v3" version = "1.0.7" -authors = [] +authors = ["OpenAPI Generator team and contributors"] description = "API under test" +# Override this license by providing a License Object in the OpenAPI. license = "Unlicense" edition = "2018" diff --git a/samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml b/samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml index 1790dc9d99d..f35a30ca567 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "no-example-v3" version = "0.0.1" -authors = [] +authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +# Override this license by providing a License Object in the OpenAPI. license = "Unlicense" edition = "2018" diff --git a/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml b/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml index 6a8b56d59c9..83ca50ef4f9 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "openapi-v3" version = "1.0.7" -authors = [] +authors = ["OpenAPI Generator team and contributors"] description = "API under test" +# Override this license by providing a License Object in the OpenAPI. license = "Unlicense" edition = "2018" @@ -41,7 +42,7 @@ serde_json = "1.0" # Crates included if required by the API definition # TODO: this should be updated to point at the official crate once # https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream -serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master"} +serde-xml-rs = {git = "https://github.com/Metaswitch/serde-xml-rs" , branch = "master"} uuid = {version = "0.8", features = ["serde", "v4"]} # Common between server and client features diff --git a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml index bcf692a43a4..e8eca6f65e9 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "ops-v3" version = "0.0.1" -authors = [] +authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +# Override this license by providing a License Object in the OpenAPI. license = "Unlicense" edition = "2018" diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml index db285f1e634..a3ecdb2f3f8 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "petstore-with-fake-endpoints-models-for-testing" version = "1.0.0" -authors = [] +authors = ["OpenAPI Generator team and contributors"] 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 = "Unlicense" +license = "Apache-2.0" edition = "2018" publish = ["crates-io"] @@ -45,7 +45,7 @@ serde_json = "1.0" # Crates included if required by the API definition # TODO: this should be updated to point at the official crate once # https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream -serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = "master"} +serde-xml-rs = {git = "https://github.com/Metaswitch/serde-xml-rs" , branch = "master"} mime_0_2 = { package = "mime", version = "0.2.6", optional = true } multipart = { version = "0.16", default-features = false, optional = true } uuid = {version = "0.8", features = ["serde", "v4"]} diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml index 4c17f555f4e..14bc8aeebe5 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml @@ -1469,6 +1469,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -1478,6 +1479,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string: @@ -1488,6 +1490,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -1560,6 +1563,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -1571,6 +1575,7 @@ components: required: - param - param2 + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/Cargo.toml b/samples/server/petstore/rust-server/output/ping-bearer-auth/Cargo.toml index afddad336f4..9b414550fb9 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/Cargo.toml +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "ping-bearer-auth" version = "1.0.0" -authors = [] +authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +# Override this license by providing a License Object in the OpenAPI. license = "Unlicense" edition = "2018" diff --git a/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml index 6e49c55ccf3..e7cc32a08a0 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml +++ b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "rust-server-test" version = "2.3.4" -authors = [] +authors = ["OpenAPI Generator team and contributors"] description = "This spec is for testing rust-server-specific things" +# Override this license by providing a License Object in the OpenAPI. license = "Unlicense" edition = "2018" 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 24f4006ce68..4e261bd4408 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 @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { /** 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 0556cdc485d..eb2dd16ccd3 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 @@ -42,7 +42,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { /** 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 e5f2a753207..e2586f6f790 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 @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { /** 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 ac8a40cea09..e4f09ff62f9 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 @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { /** 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 0e47e9557f3..32c6eda8560 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 @@ -33,7 +33,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { /** 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 00417748a12..c3bf4cafe03 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 @@ -34,7 +34,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { /** diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java index 5544aa91053..b361abf3ba3 100644 --- a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java @@ -32,7 +32,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Tag(name = "nullable", description = "the nullable API") -@RequestMapping("${openapi.apiDocumentation.base-path:}") public interface NullableApi { default Optional getRequest() { diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index f936e447191..2c9a6dcf5b7 100644 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 3e5481da3ae..cc4d05b2bb4 100644 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index ddcf8b30455..e665e2cdbf9 100644 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { 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 32fdc6a9409..3c2e959bec0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES @@ -15,6 +15,7 @@ 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/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java 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 f4a2d6d8be4..b45fcc5dc16 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 @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 65c9de6908c..c2db7ca5a81 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -28,6 +28,7 @@ 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; 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 b47f2148a01..1220ac16e00 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 @@ -35,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { 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 b30f53bb595..5ae5d5fed98 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 @@ -38,6 +38,7 @@ 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; 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 93f9b138a85..d54c2670f8e 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 @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 05196793d4c..65b695629d4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -28,6 +28,7 @@ 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; 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 0fb9cd687bb..60ccea3635b 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java index 0b88e5980bf..ea6c56e02c1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java @@ -30,6 +30,7 @@ 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; 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 efb5993d0a5..1afb547b40e 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 @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; 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 3ef80124bdd..981e3a95cbe 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 5fdcfc33ead..2999e6f2f8d 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 @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES index ff6da0b88a7..d61b6cf83bf 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES @@ -15,6 +15,7 @@ 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/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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 f4a2d6d8be4..b45fcc5dc16 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 @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 65c9de6908c..c2db7ca5a81 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -28,6 +28,7 @@ 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; 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 b47f2148a01..1220ac16e00 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 @@ -35,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { 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 b30f53bb595..5ae5d5fed98 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 @@ -38,6 +38,7 @@ 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; 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 93f9b138a85..d54c2670f8e 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 @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 05196793d4c..65b695629d4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -28,6 +28,7 @@ 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; 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 0fb9cd687bb..60ccea3635b 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java index 0b88e5980bf..ea6c56e02c1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java @@ -30,6 +30,7 @@ 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; 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 efb5993d0a5..1afb547b40e 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 @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; 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 3ef80124bdd..981e3a95cbe 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES index 84b7f1df792..07f63a0e8be 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES @@ -21,6 +21,7 @@ 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/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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 b95ecc2a3e5..ffa28f49372 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 @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default AnotherFakeApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7c3f2049247..e27e2fc20ea 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -27,6 +27,7 @@ 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; 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 9b0ae8c32e2..261a033dd80 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 @@ -31,7 +31,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default FakeApiDelegate getDelegate() { 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 8e624ba5fb5..726b17779f1 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 @@ -37,6 +37,7 @@ 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; 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 db8c89a66de..ecc2a625ddf 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 @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default FakeClassnameTestApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 48a276daf13..21e28fe8b21 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -27,6 +27,7 @@ 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; 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 f87a341daba..16b3566374e 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 @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default PetApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java index e27c4c3b49d..5ef3de965ff 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -29,6 +29,7 @@ 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 PetApiDelegate delegate; 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 56acbae4f2d..c9e8abe50bf 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 @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default StoreApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java index 8c3b33a99af..e9e29a41b4f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -28,6 +28,7 @@ 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 StoreApiDelegate delegate; 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 95da9031c99..e960ec9acd6 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 @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default UserApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java index 58511a07291..1b48d4a9444 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -29,6 +29,7 @@ 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 UserApiDelegate delegate; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 5fdcfc33ead..2999e6f2f8d 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 @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES index 84b7f1df792..07f63a0e8be 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -21,6 +21,7 @@ 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/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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 b95ecc2a3e5..ffa28f49372 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 @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default AnotherFakeApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7c3f2049247..e27e2fc20ea 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -27,6 +27,7 @@ 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; 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 9b0ae8c32e2..261a033dd80 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 @@ -31,7 +31,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default FakeApiDelegate getDelegate() { 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 8e624ba5fb5..726b17779f1 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 @@ -37,6 +37,7 @@ 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; 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 db8c89a66de..ecc2a625ddf 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 @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default FakeClassnameTestApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 48a276daf13..21e28fe8b21 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -27,6 +27,7 @@ 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; 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 f87a341daba..16b3566374e 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 @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default PetApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index e27c4c3b49d..5ef3de965ff 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -29,6 +29,7 @@ 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 PetApiDelegate delegate; 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 56acbae4f2d..c9e8abe50bf 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 @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default StoreApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java index 8c3b33a99af..e9e29a41b4f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java @@ -28,6 +28,7 @@ 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 StoreApiDelegate delegate; 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 95da9031c99..e960ec9acd6 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 @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default UserApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java index 58511a07291..1b48d4a9444 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java @@ -29,6 +29,7 @@ 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 UserApiDelegate delegate; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java index 14255de87c3..9b66d42d356 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApiController.java index 7713fe93c41..b8fa3720a21 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApiController.java @@ -29,6 +29,7 @@ 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; diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java index c5429143617..3044b699b0d 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java index 37da2fb80a0..66fab2a5f57 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 32fdc6a9409..3c2e959bec0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -15,6 +15,7 @@ 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/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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 f4a2d6d8be4..b45fcc5dc16 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 @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 65c9de6908c..c2db7ca5a81 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -28,6 +28,7 @@ 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; 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 bf9416bbe20..88b13d87041 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 @@ -35,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { 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 b30f53bb595..5ae5d5fed98 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 @@ -38,6 +38,7 @@ 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; 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 93f9b138a85..d54c2670f8e 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 @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 05196793d4c..65b695629d4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -28,6 +28,7 @@ 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; 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 0ce854da3a5..c79ba12a30f 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java index 0b88e5980bf..ea6c56e02c1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApiController.java @@ -30,6 +30,7 @@ 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; 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 efb5993d0a5..1afb547b40e 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 @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; 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 3ef80124bdd..981e3a95cbe 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES index b552438ed41..bf09bb15ac7 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES @@ -21,6 +21,7 @@ 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 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 37759a05028..9aa14c56592 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 @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default AnotherFakeApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java index ac91b64909a..c9afaab792d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -28,6 +28,7 @@ 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; 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 c05f795e57b..5e5979845e8 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 @@ -47,7 +47,7 @@ public interface AnotherFakeApiDelegate { break; } } - return result.then(Mono.empty()); + return result.then(body).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 60bfd18f1d2..f598c332026 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 @@ -36,7 +36,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default FakeApiDelegate getDelegate() { 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 113e8668392..db9b0dff167 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 @@ -38,6 +38,7 @@ 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; 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 9571f3da3eb..67da639c92c 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 @@ -50,7 +50,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(xmlItem).then(Mono.empty()); } @@ -66,7 +66,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -89,7 +89,7 @@ public interface FakeApiDelegate { break; } } - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -105,7 +105,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -121,7 +121,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -137,7 +137,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -154,7 +154,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -177,7 +177,7 @@ public interface FakeApiDelegate { break; } } - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -292,7 +292,7 @@ public interface FakeApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(param).then(Mono.empty()); } 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 36130cafe7e..789b88876a4 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 @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default FakeClassnameTestApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 99cb9416db6..f98a29c1d78 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -28,6 +28,7 @@ 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; 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 527bedeecf9..6c9ea314d72 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 @@ -47,7 +47,7 @@ public interface FakeClassnameTestApiDelegate { break; } } - return result.then(Mono.empty()); + return result.then(body).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 7eae0dd9c2e..2286bc126ea 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 @@ -28,7 +28,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default PetApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java index df2e9ebac57..4b6a806bf6d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java @@ -30,6 +30,7 @@ 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 PetApiDelegate delegate; 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 b64cb0f503f..ebd80762c87 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 @@ -42,7 +42,7 @@ public interface PetApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -168,7 +168,7 @@ public interface PetApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } 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 281c714e996..826fe6283a3 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default StoreApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java index 0f1102844b4..72b8085628c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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 StoreApiDelegate delegate; 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 ecc745c202f..0d94aece422 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 @@ -114,7 +114,7 @@ public interface StoreApiDelegate { break; } } - return result.then(Mono.empty()); + return result.then(body).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 8e1c343f6bb..2e7af65dc8b 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 @@ -28,7 +28,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default UserApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java index 840baa17112..6d3effb9ec3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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 UserApiDelegate delegate; 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 3e561778a3e..bb61d43b378 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 @@ -42,7 +42,7 @@ public interface UserApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } @@ -57,7 +57,7 @@ public interface UserApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.thenMany(body).then(Mono.empty()); } @@ -72,7 +72,7 @@ public interface UserApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.thenMany(body).then(Mono.empty()); } @@ -168,7 +168,7 @@ public interface UserApiDelegate { ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); + return result.then(body).then(Mono.empty()); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES index cfad6877d8e..7a4d79c7e10 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES @@ -21,6 +21,7 @@ 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/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index b95ecc2a3e5..ffa28f49372 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default AnotherFakeApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7c3f2049247..e27e2fc20ea 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -27,6 +27,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index c9971826e6f..599c2a879c5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -31,7 +31,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default FakeApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index 8e624ba5fb5..726b17779f1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -37,6 +37,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index db8c89a66de..ecc2a625ddf 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default FakeClassnameTestApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 48a276daf13..21e28fe8b21 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -27,6 +27,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index e1e9490880a..c1d022bbe33 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default PetApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 1218abedfa6..66563562337 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -30,6 +30,7 @@ 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 PetApiDelegate delegate; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 56acbae4f2d..c9e8abe50bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default StoreApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index 8c3b33a99af..e9e29a41b4f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -28,6 +28,7 @@ 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 StoreApiDelegate delegate; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 95da9031c99..e960ec9acd6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default UserApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java index 58511a07291..1b48d4a9444 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -29,6 +29,7 @@ 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 UserApiDelegate delegate; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 81cc16dcab2..d28bcff839b 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 @@ -2105,6 +2105,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2114,6 +2115,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2133,6 +2135,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2205,6 +2208,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2216,6 +2220,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2227,6 +2232,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES index cfad6877d8e..7a4d79c7e10 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES @@ -21,6 +21,7 @@ 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/configuration/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index b95ecc2a3e5..ffa28f49372 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default AnotherFakeApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7c3f2049247..e27e2fc20ea 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -27,6 +27,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index c9971826e6f..599c2a879c5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -31,7 +31,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default FakeApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java index 8e624ba5fb5..726b17779f1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java @@ -37,6 +37,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index db8c89a66de..ecc2a625ddf 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -21,7 +21,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default FakeClassnameTestApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 48a276daf13..21e28fe8b21 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -27,6 +27,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index e1e9490880a..c1d022bbe33 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java @@ -24,7 +24,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default PetApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java index 1218abedfa6..66563562337 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java @@ -30,6 +30,7 @@ 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 PetApiDelegate delegate; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index 56acbae4f2d..c9e8abe50bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java @@ -22,7 +22,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default StoreApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java index 8c3b33a99af..e9e29a41b4f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java @@ -28,6 +28,7 @@ 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 StoreApiDelegate delegate; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index 95da9031c99..e960ec9acd6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -23,7 +23,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default UserApiDelegate getDelegate() { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java index 58511a07291..1b48d4a9444 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java @@ -29,6 +29,7 @@ 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 UserApiDelegate delegate; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 81cc16dcab2..d28bcff839b 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 @@ -2105,6 +2105,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2114,6 +2115,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2133,6 +2135,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2205,6 +2208,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2216,6 +2220,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2227,6 +2232,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES index 2696c0211eb..82b3e0b0d8f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES @@ -15,6 +15,7 @@ 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/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index f4a2d6d8be4..b45fcc5dc16 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 65c9de6908c..c2db7ca5a81 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -28,6 +28,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index e5756b6741b..c07a605db9d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -35,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index b30f53bb595..5ae5d5fed98 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 93f9b138a85..d54c2670f8e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 05196793d4c..65b695629d4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -28,6 +28,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index 76518260a29..f6c886ac94c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -28,7 +28,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 58de86d8ac7..ab60617a7ee 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -31,6 +31,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index efb5993d0a5..1afb547b40e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 3ef80124bdd..981e3a95cbe 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 81cc16dcab2..d28bcff839b 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 @@ -2105,6 +2105,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2114,6 +2115,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2133,6 +2135,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2205,6 +2208,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2216,6 +2220,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2227,6 +2232,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES index 2696c0211eb..82b3e0b0d8f 100644 --- a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES @@ -15,6 +15,7 @@ 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/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index f4a2d6d8be4..b45fcc5dc16 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 65c9de6908c..c2db7ca5a81 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -28,6 +28,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index e5756b6741b..c07a605db9d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -35,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java index b30f53bb595..5ae5d5fed98 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java @@ -38,6 +38,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 93f9b138a85..d54c2670f8e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 05196793d4c..65b695629d4 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -28,6 +28,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 76518260a29..f6c886ac94c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -28,7 +28,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java index 58de86d8ac7..ab60617a7ee 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java @@ -31,6 +31,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index efb5993d0a5..1afb547b40e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 3ef80124bdd..981e3a95cbe 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 81cc16dcab2..d28bcff839b 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 @@ -2105,6 +2105,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2114,6 +2115,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2133,6 +2135,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2205,6 +2208,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2216,6 +2220,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2227,6 +2232,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES index 32fdc6a9409..3c2e959bec0 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES @@ -15,6 +15,7 @@ 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/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java 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 f4a2d6d8be4..b45fcc5dc16 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 @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 65c9de6908c..c2db7ca5a81 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -28,6 +28,7 @@ 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; 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 63c01f774a6..b8085e150ec 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 @@ -35,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { 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 b30f53bb595..5ae5d5fed98 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 @@ -38,6 +38,7 @@ 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; 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 93f9b138a85..d54c2670f8e 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 @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 05196793d4c..65b695629d4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -28,6 +28,7 @@ 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; 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 82244088b6b..6d85c297c39 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java index 0b88e5980bf..ea6c56e02c1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java @@ -30,6 +30,7 @@ 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; 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 efb5993d0a5..1afb547b40e 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 @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; 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 3ef80124bdd..981e3a95cbe 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES index 242b5258470..408f3973f3e 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES @@ -2,6 +2,7 @@ README.md pom.xml src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.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/virtualan/api/AnotherFakeApi.java diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..1af17cc2ace --- /dev/null +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +package org.openapitools.configuration; + +import org.openapitools.virtualan.model.EnumClass; +import org.openapitools.virtualan.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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} 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 8cde7d4cdd4..cb271de8817 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 @@ -35,7 +35,6 @@ import javax.annotation.Generated; @Validated @Tag(name = "another-fake", description = "the another-fake API") @VirtualService -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java index 8430d80bd92..dd5594acb67 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java @@ -28,6 +28,7 @@ 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; 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 1a993aa1907..d610b3cc014 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 @@ -45,7 +45,6 @@ import javax.annotation.Generated; @Validated @Tag(name = "fake", description = "the fake API") @VirtualService -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { 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 d733bfab3a4..d33842e20df 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 @@ -38,6 +38,7 @@ 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; 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 b325c98f299..a95cbe23b7a 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 @@ -35,7 +35,6 @@ import javax.annotation.Generated; @Validated @Tag(name = "fake_classname_test", description = "the fake_classname_test API") @VirtualService -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java index 4db741afee9..f4d0eedc19c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java @@ -28,6 +28,7 @@ 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; 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 220e8af2004..e37f6b77f60 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 @@ -37,7 +37,6 @@ import javax.annotation.Generated; @Validated @Tag(name = "pet", description = "Everything about your Pets") @VirtualService -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java index 0b171a217de..94ea48fcc81 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java @@ -30,6 +30,7 @@ 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; 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 9b7848e2787..9f5d667b14e 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 @@ -36,7 +36,6 @@ import javax.annotation.Generated; @Validated @Tag(name = "store", description = "Access to Petstore orders") @VirtualService -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java index 1d865458002..bc986cbdf0a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; 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 a0d96ce38e1..e9dfc2dcfbf 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 @@ -37,7 +37,6 @@ import javax.annotation.Generated; @Validated @Tag(name = "user", description = "Operations about user") @VirtualService -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java index 10575bc75fb..65303c96a8a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApiController.java @@ -30,6 +30,7 @@ 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; 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 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/samples/server/petstore/springboot/.openapi-generator/FILES b/samples/server/petstore/springboot/.openapi-generator/FILES index 32fdc6a9409..3c2e959bec0 100644 --- a/samples/server/petstore/springboot/.openapi-generator/FILES +++ b/samples/server/petstore/springboot/.openapi-generator/FILES @@ -15,6 +15,7 @@ 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/SpringFoxConfiguration.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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 f4a2d6d8be4..b45fcc5dc16 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 @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "another-fake", description = "the another-fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface AnotherFakeApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 65c9de6908c..c2db7ca5a81 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -28,6 +28,7 @@ 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; 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 b47f2148a01..1220ac16e00 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 @@ -35,7 +35,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake", description = "the fake API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeApi { default Optional getRequest() { 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 b30f53bb595..5ae5d5fed98 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 @@ -38,6 +38,7 @@ 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; 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 93f9b138a85..d54c2670f8e 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 @@ -25,7 +25,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface FakeClassnameTestApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 05196793d4c..65b695629d4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -28,6 +28,7 @@ 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; 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 0fb9cd687bb..60ccea3635b 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface PetApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java index 0b88e5980bf..ea6c56e02c1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApiController.java @@ -30,6 +30,7 @@ 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; 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 efb5993d0a5..1afb547b40e 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 @@ -26,7 +26,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface StoreApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java index f8c784ff383..1292dc0b721 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApiController.java @@ -29,6 +29,7 @@ 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; 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 3ef80124bdd..981e3a95cbe 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 @@ -27,7 +27,6 @@ import javax.annotation.Generated; @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") @Validated @Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public interface UserApi { default Optional getRequest() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java index 894bf6db762..ca00184d2a5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApiController.java @@ -30,6 +30,7 @@ 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; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 00000000000..a9db83785d2 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,32 @@ +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 + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClass convert(String source) { + return EnumClass.fromValue(source); + } + }; + } + @Bean + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnum convert(String source) { + return OuterEnum.fromValue(source); + } + }; + } + +} diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java index 36dfd34883e..b7484deccc2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java @@ -77,9 +77,9 @@ public class Model200Response { 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); + Model200Response _200Response = (Model200Response) o; + return Objects.equals(this.name, _200Response.name) && + Objects.equals(this.propertyClass, _200Response.propertyClass); } @Override diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java index 97ddf5359aa..4bb0e66c867 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelList.java @@ -25,25 +25,25 @@ import javax.annotation.Generated; public class ModelList { @JsonProperty("123-list") - private String _123list; + private String _123List; - public ModelList _123list(String _123list) { - this._123list = _123list; + public ModelList _123List(String _123List) { + this._123List = _123List; return this; } /** - * Get _123list - * @return _123list + * Get _123List + * @return _123List */ @ApiModelProperty(value = "") - public String get123list() { - return _123list; + public String get123List() { + return _123List; } - public void set123list(String _123list) { - this._123list = _123list; + public void set123List(String _123List) { + this._123List = _123List; } @Override @@ -55,19 +55,19 @@ public class ModelList { return false; } ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); + return Objects.equals(this._123List, _list._123List); } @Override public int hashCode() { - return Objects.hash(_123list); + 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(" _123List: ").append(toIndentedString(_123List)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java index 51cc37bbeea..41a7593f0ef 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java @@ -33,7 +33,7 @@ public class Name { private String property; @JsonProperty("123Number") - private Integer _123number; + private Integer _123Number; public Name name(Integer name) { this.name = name; @@ -92,23 +92,23 @@ public class Name { this.property = property; } - public Name _123number(Integer _123number) { - this._123number = _123number; + public Name _123Number(Integer _123Number) { + this._123Number = _123Number; return this; } /** - * Get _123number - * @return _123number + * Get _123Number + * @return _123Number */ @ApiModelProperty(readOnly = true, value = "") - public Integer get123number() { - return _123number; + public Integer get123Number() { + return _123Number; } - public void set123number(Integer _123number) { - this._123number = _123number; + public void set123Number(Integer _123Number) { + this._123Number = _123Number; } @Override @@ -123,12 +123,12 @@ public class Name { 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); + Objects.equals(this._123Number, name._123Number); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); + return Objects.hash(name, snakeCase, property, _123Number); } @Override @@ -138,7 +138,7 @@ public class Name { 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(" _123Number: ").append(toIndentedString(_123Number)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..62a43315498 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java @@ -25,25 +25,25 @@ import javax.annotation.Generated; public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long $specialPropertyName; + private Long $SpecialPropertyName; - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; + public SpecialModelName $SpecialPropertyName(Long $SpecialPropertyName) { + this.$SpecialPropertyName = $SpecialPropertyName; return this; } /** - * Get $specialPropertyName - * @return $specialPropertyName + * Get $SpecialPropertyName + * @return $SpecialPropertyName */ @ApiModelProperty(value = "") public Long get$SpecialPropertyName() { - return $specialPropertyName; + return $SpecialPropertyName; } - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; + public void set$SpecialPropertyName(Long $SpecialPropertyName) { + this.$SpecialPropertyName = $SpecialPropertyName; } @Override @@ -54,20 +54,20 @@ 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 public int hashCode() { - return Objects.hash($specialPropertyName); + 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(" $SpecialPropertyName: ").append(toIndentedString($SpecialPropertyName)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/server/petstore/springboot/src/main/resources/openapi.yaml index 5fdcfc33ead..2999e6f2f8d 100644 --- a/samples/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot/src/main/resources/openapi.yaml @@ -2111,6 +2111,7 @@ components: status: description: Updated status of the pet type: string + type: object uploadFile_request: properties: additionalMetadata: @@ -2120,6 +2121,7 @@ components: description: file to upload format: binary type: string + type: object testEnumParameters_request: properties: enum_form_string_array: @@ -2139,6 +2141,7 @@ components: - -efg - (xyz) type: string + type: object testEndpointParameters_request: properties: integer: @@ -2211,6 +2214,7 @@ components: - double - number - pattern_without_delimiter + type: object testJsonFormData_request: properties: param: @@ -2222,6 +2226,7 @@ components: required: - param - param2 + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2233,6 +2238,7 @@ components: type: string required: - requiredFile + type: object Dog_allOf: properties: breed: diff --git a/website/src/css/custom.css b/website/src/css/custom.css index 9b0a11ddcf5..e9dba89d72b 100755 --- a/website/src/css/custom.css +++ b/website/src/css/custom.css @@ -41,6 +41,7 @@ html[data-theme=''] .navbar__logo { .avatar__photo-link.bronze-sponsor { display: flex; + flex-wrap: wrap; margin-left: var(--button-margin); } @@ -138,4 +139,4 @@ dd { } @media only screen and (min-width: 1500px) { -} \ No newline at end of file +} diff --git a/website/src/dynamic/sponsors.yml b/website/src/dynamic/sponsors.yml index 37a2a21262c..d2a273c6d87 100644 --- a/website/src/dynamic/sponsors.yml +++ b/website/src/dynamic/sponsors.yml @@ -53,3 +53,13 @@ image: "img/companies/mergedev.jpeg" infoLink: "https://www.merge.dev/?utm_source=openapi_generator&utm_medium=official_website&utm_campaign=sponsor" bronze: true +- + caption: "Bürkert" + image: "img/companies/burkert.jpg" + infoLink: "https://www.burkert.com/?utm_source=openapi_generator&utm_medium=official_website&utm_campaign=sponsor" + bronze: true +- + caption: "FINBOURNE" + image: "img/companies/finbourne.png" + infoLink: "https://www.finbourne.com/?utm_source=openapi_generator&utm_medium=official_website&utm_campaign=sponsor" + bronze: true diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml index 46c979332c9..4fc40b7937e 100644 --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -408,6 +408,11 @@ image: "img/companies/prometheus.png" infoLink: "https://github.com/prometheus/alertmanager" pinned: false +- + caption: "PTV Group" + image: "img/companies/ptvgroup.png" + infoLink: "https://www.myptv.com/" + pinned: false - caption: Puppet image: "img/companies/puppet.svg" @@ -513,6 +518,11 @@ image: "img/companies/infotec.png" infoLink: "http://www.tui-infotec.com/" pinned: false +- + caption: "Twilio" + image: "img/companies/twilio.png" + infoLink: "https://twilio.com" + pinned: false - caption: "Twitter" image: "img/companies/twitter.png" diff --git a/website/src/pages/styles.module.css b/website/src/pages/styles.module.css index 5f0cea73ad0..cadcabf4290 100644 --- a/website/src/pages/styles.module.css +++ b/website/src/pages/styles.module.css @@ -64,6 +64,7 @@ .bronzeSponsorAvatars { display: inline-flex; + flex-wrap: wrap; } @media screen and (max-width: 966px) { diff --git a/website/static/img/companies/burkert.jpg b/website/static/img/companies/burkert.jpg new file mode 100644 index 00000000000..c4bf6aeb957 Binary files /dev/null and b/website/static/img/companies/burkert.jpg differ diff --git a/website/static/img/companies/finbourne.png b/website/static/img/companies/finbourne.png new file mode 100644 index 00000000000..631c6142da5 Binary files /dev/null and b/website/static/img/companies/finbourne.png differ diff --git a/website/static/img/companies/ptvgroup.png b/website/static/img/companies/ptvgroup.png new file mode 100644 index 00000000000..8aafa7504b8 Binary files /dev/null and b/website/static/img/companies/ptvgroup.png differ diff --git a/website/static/img/companies/twilio.png b/website/static/img/companies/twilio.png new file mode 100644 index 00000000000..1c3f24f011f Binary files /dev/null and b/website/static/img/companies/twilio.png differ